ssh - 如何防止与dataproc上的SOCKS的“连接被拒绝”?

标签 ssh socks google-cloud-dataproc

我正在尝试在the Google Jupyter guide之后建立到我的dataproc spark集群的SOCKS连接,但是在启动浏览器Chrome之后,我一直收到“连接被拒绝”错误:

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 7: open failed: connect failed: Connection refused
channel 8: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 16: open failed: connect failed: Connection refused
channel 16: open failed: administratively prohibited: open failed
channel 17: open failed: administratively prohibited: open failed
channel 18: open failed: administratively prohibited: open failed
channel 16: open failed: connect failed: Connection refused
channel 18: open failed: connect failed: Connection refused
channel 18: open failed: connect failed: Connection refused
channel 18: open failed: connect failed: Connection refused


--proxy-server="socks5://localhost:1080"--proxy-server="socks5://127.0.0.1:1080"都会发生这种情况

最佳答案

因此,我不确定100%是“管理上禁止”消息的来源,但是根据我的经验,这些消息始终是虚假警报,即使我的袜子代理正常运行,我仍然看到这些open failed: administratively prohibited: open failed消息。

至于实际问题,由于YARN之类的东西绑定其Web服务的方式,如果尝试使用Connection refused而不是http://localhost:8088访问YARN UI,则已经得到http://<master-hostname>:8088了。这与在群集中运行get的行为相匹配:

dhuo@dhuo-jupyter-m:~$ wget http://localhost:8124
...
Saving to: ‘index.html.13’

index.html.13                                                          100%[=============================================================================================================================================================================>]  11.41K  --.-KB/s   in 0s     

2016-07-15 23:26:25 (222 MB/s) - ‘index.html.13’ saved [11686/11686]

dhuo@dhuo-jupyter-m:~$ wget http://localhost:8088
--2016-07-15 23:26:28--  http://localhost:8088/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8088... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8088... failed: Connection refused.
dhuo@dhuo-jupyter-m:~$ wget http://`hostname`:8124
...
Saving to: ‘index.html.14’

index.html.14                                                          100%[=============================================================================================================================================================================>]  11.41K  --.-KB/s   in 0s     

2016-07-15 23:26:34 (260 MB/s) - ‘index.html.14’ saved [11686/11686]

dhuo@dhuo-jupyter-m:~$ wget http://`hostname`:8088
...
Saving to: ‘index.html.15’

index.html.15                                                          100%[=============================================================================================================================================================================>]  10.81K  --.-KB/s   in 0s     

2016-07-15 23:26:37 (248 MB/s) - ‘index.html.15’ saved [11067/11067]


如您所见,这与Jupyter的行为(我在端口8124上运行)不同,在Jupyter的webapp上,它可以正确解析主服务器上的localhost:8124。由于带有这些链接说明的名称解析应在主服务器上进行,因此浏览器的行为解析主机将与在隧道中进入的节点中运行wget相同。

因此,如果您仅使用主机的主机名而不是localhost,则它应该可以工作。

关于ssh - 如何防止与dataproc上的SOCKS的“连接被拒绝”?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38386058/

相关文章:

dns - 当有 SOCKS 代理时,为什么我的脚本遵循/etc/hosts 但浏览器不遵循?

python-2.7 - PySpark打印到控制台

google-cloud-dataproc - 在 Dataproc 集群节点上设置环境变量

python - 在 windows 中使用 python 在 linux 上运行远程 perl 脚本

proxy - 单个 SSH SOCKS 5 代理中的多个连接

proxy - 动态获取代理服务器详细信息时来自 SOCKS 服务器的格式错误的回复

python - 如何在Python中的请求中禁用代理socks5?

google-cloud-dataproc - 我应该把 jar 放在 dataproc 集群的什么地方,以便 gcloud dataproc jobs submit spark 可以使用它们?

ruby-on-rails - 执行 "mina setup"时没有任何反应

ssh - 我可以通过 Chrome 操作系统连接到 Google Cloud VM 吗?