【问题标题】:Cannot start dask cluster over SSH无法通过 SSH 启动 dask 集群
【发布时间】:2018-11-12 04:57:53
【问题描述】:

我正在尝试通过 SSH 启动一个 dask 集群,但遇到了类似以下的奇怪错误:

Exception in thread Thread-6:
Traceback (most recent call last):
  File "/home/localuser/miniconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/localuser/miniconda3/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/localuser/miniconda3/lib/python3.6/site-packages/distributed/deploy/ssh.py", line 57, in async_ssh
    banner_timeout=20)  # Helps prevent timeouts when many concurrent ssh connections are opened.
  File "/home/localuser/miniconda3/lib/python3.6/site-packages/paramiko/client.py", line 329, in connect
    to_try = list(self._families_and_addresses(hostname, port))
  File "/home/localuser/miniconda3/lib/python3.6/site-packages/paramiko/client.py", line 200, in _families_and_addresses
    hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM)
  File "/home/localuser/miniconda3/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

我正在像这样启动集群:

$ dask-ssh --ssh-private-key ~/.ssh/cluster_id_rsa \
      --hostfile ~/dask-hosts.txt \
      --remote-python "~/miniconda3/bin/python3.6"

我的dask-hosts.txt 看起来像这样:

localuser@127.0.0.1
remoteuser@10.10.4.200
...
remoteuser@10.10.4.207

无论有没有 localhost 行,我都会遇到同样的错误。

我已经检查了 ssh 设置,我可以使用公钥设置登录到所有节点(密钥未加密,以避免出现解密提示)。我错过了什么?

【问题讨论】:

    标签: dask dask-distributed


    【解决方案1】:

    该错误表明名称解析是罪魁祸首。这很可能是因为您的dask-hosts.txt 中包含用户名。根据its documentation,主机文件应该只包含主机名/IP 地址:

    –hostfile PATH 带有主机名/IP 地址的文本文件

    您可以使用--ssh-username 设置用户名(虽然只有一个)。

    【讨论】:

    • 就是这样!我以为我已经尝试过了,我想没有。我希望有一种方法可以指定不同的用户名。
    • 是的,如果还不能解决限制,这似乎是一个合理的功能;您可以尝试在github.com/dask/distributed/issues 上提交有关它的问题。
    猜你喜欢
    • 2021-07-12
    • 1970-01-01
    • 1970-01-01
    • 2020-09-18
    • 2018-03-11
    • 1970-01-01
    • 2023-03-22
    • 2012-12-01
    • 2016-08-21
    相关资源
    最近更新 更多