2017-04-14 95 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中。 希望有所幫助。