2017-04-14 68 views
0

我使用Google Cloud Dataproc运行Jupyter笔记本(按照以下说明操作:https://cloud.google.com/dataproc/docs/tutorials/jupyter-notebook)。在停止群集后,无法在Google Cloud Dataproc群集上重新打开Jupyter笔记本电脑

我运行了一个笔记本,保存了它,然后在稍后的某个时候停止了集群(使用GUI)。再后来我重新启动集群,并试图用相同的指令再次运行Jupyter笔记本,但在最后一步,当我尝试在Chrome中打开Jupyter我得到:

"This site can't be reached. The webpage at http://<my-cluster-name>:8123/ might be temporarily down or it may have moved permanently to a new web address. ERR_SOCKS_CONNECTION_FAILED." 

也(我不知道,如果这帮助)在我配置浏览器中的终端窗口,我有一个消息:

ERROR:child_thread_impl.cc(762)] Request for unknown Channel-associated interface: ui::mojom::GpuMain 
Google Chrome[695:8548] NSWindow warning: adding an unknown subview: <FullSizeContentView: 0x7fdfd3e291e0>. Break on NSLog to debug. 
Google Chrome[695:8548] Call stack: 
(
"+callStackSymbols disabled for performance reasons" 
) 

在我ssh-ED到我的群集终端窗口我有这些消息:

channel 3: open failed: connect failed: Connection refused 
channel 4: open failed: connect failed: Connection refused 
channel 5: open failed: connect failed: Connection refused  
channel 6: open failed: connect failed: Connection refused 
channel 12: open failed: connect failed: Connection refused 
channel 12: open failed: administratively prohibited: open failed 
channel 13: open failed: administratively prohibited: open failed 
channel 14: open failed: administratively prohibited: open failed 
channel 14: open failed: connect failed: Connection refused 
channel 8: open failed: connect failed: Connection refused 

另外,耳在我停止集群之前,我可以关闭jupyter笔记本电脑,从集群中断开连接,然后重新打开jupyter笔记本电脑。我在停止集群后才遇到这个问题。任何想法可能会发生什么?

+0

[关闭并在Google云虚拟机(计算引擎)上动态端口转发失败的可能重复](http://stackoverflow.com/questions/42556490/dynamic-port-forwarding-fails-after-turning-关闭和开启-谷歌云虚马赫) – tix

回答

1

这是因为当前initialization action明确启动jupyter笔记本服务调用launch-jupyter-kernel.sh。初始化操作与GCE启动脚本不同,因为它们不会在启动时重新运行;意图通常是初始化动作不必是幂等的,但是如果他们想要在启动时重新启动,则需要添加一些init.d/systemd配置来明确地这样做。

对于一次性的情况下,你可以SSH到主,然后做:

sudo su 
source /etc/profile.d/conda.sh 
nohup jupyter notebook --allow-root --no-browser >> /var/log/jupyter_notebook.log 2>&1 & 

如果你想这在启动时自动发生,你可以尝试把在一个startup script via GCE metadata,虽然如果您在集群创建时这样做,则需要确保它不会与Dataproc初始化操作相冲突(另外,启动脚本可能会在dataproc init操作之前运行,因此您可能只想允许第一次尝试默默地失败)。

长期来看,我们应该更新初始化操作以将条目添加到init.d/systemd中,以便init操作本身在重新启动时配置自动重新启动。目前没有人专注于此,但如果您或任何您认识的人都能完成任务,那么贡献总是受到赞赏;我提交https://github.com/GoogleCloudPlatform/dataproc-initialization-actions/issues/108来跟踪此功能。

0

我通过使用ssh连接到主机来解决了这个问题,并创建了一个systemd服务(接着上面的dennis-huo的注释)。

  1. 到/ usr/lib中/ systemd /系统
  2. 须藤苏
  3. 创建一个名为 “jupyter-notebook.service” 一个systemd单元文件的内容

    [Unit] 
    Description=Start Jupyter Notebook Server at reboot 
    
    [Service] 
    Type=simple 
    ExecStart=/opt/conda/bin/jupyter notebook --allow-root --no-browser 
    
    [Install] 
    WantedBy=multi-user.target 
    
  4. systemctl守护-reload

  5. systemctl enable jupyter-notebook.service
  6. sys temctl启动jupyter笔记本。服务

下一步将包括上述代码到dataproc-initialization-actions中。 希望有所帮助。

相关问题