我正在尝试通过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设置,我可以使用公共密钥设置登录所有节点(该密钥未加密,以避免出现解密提示)。我想念什么?
答案 0 :(得分:1)
该错误表明名称解析是罪魁祸首。这很可能是由于dask-hosts.txt
中包含了用户名而导致的。根据{{3}},主机文件应仅包含主机名/ IP地址:
–hostfile PATH带有主机名/ IP地址的文本文件
您可以使用--ssh-username
设置用户名(尽管只有一个)。