【问题标题】:Google Dataproc - Unable to connect via SSHGoogle Dataproc - 无法通过 SSH 连接
【发布时间】:2018-07-01 00:20:10
【问题描述】:

我按照official documentation 中列出的说明在 Cloud Dataproc 集群上安装了 Cloud Datalab 笔记本

创建集群后,我在 Cloud Shell 中创建了一个到主节点的 SSH 隧道,并使用 Cloud Shell 连接到集群接口。 Instructions。在此之后我可以访问 Jupyter 笔记本。我使用了-v 详细选项来查看 SSH 连接日志:

gcloud compute ssh cluster-datalab-m --project=abcxyz-123 --zone us-west1-a \
    -- -v -4 -N -L 8080:cluster-datalab-m:8080

但一段时间后,我收到一个弹出窗口,提示“无法建立与笔记本服务器的连接。笔记本将继续尝试重新连接。请检查您的网络连接或笔记本服务器配置。”我的集群停止响应任何命令。

当我查看 Cloud Shell 上的 SSH 输出时,我看到此时正在请求多个通道。

断点期间的 SSH 日志预览:

debug1: channel 1: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 2: new [direct-tcpip]
debug1: channel 1: free: direct-tcpip: listening port 8080 for cluster-datalab-m port 8080, connect from 127.0.0.1 port 52832 to 127.0.0.1 port 8080, nchannels 3
debug1: channel 2: free: direct-tcpip: listening port 8080 for cluster-datalab-m port 8080, connect from 127.0.0.1 port 52833 to 127.0.0.1 port 8080, nchannels 2
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 1: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 2: new [direct-tcpip]
debug1: channel 2: free: direct-tcpip: listening port 8080 for cluster-datalab-m port 8080, connect from 127.0.0.1 port 52837 to 127.0.0.1 port 8080, nchannels 3
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 2: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 3: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 4: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 5: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.
debug1: channel 6: new [direct-tcpip]
debug1: Connection to port 8080 forwarding to cluster-datalab-m port 8080 requested.

我手动关闭了这个 SSH 连接,然后尝试通过单击 Compute Engine 控制台上的 SSH 按钮通过 SSH 连接到主节点,但即使这样也需要很多时间并且没有成功完成。

我查看了这个* question,但在主节点中找不到任何/etc/sshguard 文件夹,所以我认为这不是我的问题。主节点运行的是 Debian 8.10。

有什么方法可以确保 SSH 连接(和 Jupyter notebook)持续工作?

【问题讨论】:

标签: google-compute-engine google-cloud-dataproc google-cloud-datalab


【解决方案1】:

我们更新了cluster web interfaces 的文档。使用云外壳适用于 Datalab,但不适用于 Jupyter。 Cloud Shell Preview 仅支持 HTTP,但 Jupyter 使用 websocket。

相反,您应该按照instructions 设置 SOCKS 代理并将 Chrome 指向它。有一个方便的 bash script 称为 launch-jupyter-interface.sh 可以为您做到这一点。您只需修改它以指向您的 Chrome 安装。

Jupyter tutorial 也提到使用该脚本。

【讨论】: