from dask.distributed import Client, SSHCluster
cluster = SSHCluster(["localhost", "192.168.x.x"],
connect_options={"known_hosts": None, "username": "xxxx", "client_keys": "~/.ssh/dask" },
worker_options={"nthreads": 2},
scheduler_options={"port": 0, "dashboard_address": ":8797"})
client = Client(cluster)
获取错误
File "/home/naveen/anaconda3/envs/dask_env/lib/python3.8/site-packages/asyncssh/connection.py", line 218, in _connect
await conn.wait_established()
File "/home/naveen/anaconda3/envs/dask_env/lib/python3.8/site-packages/asyncssh/connection.py", line 2096, in wait_established
await self._waiter
asyncssh.misc.PermissionDenied: Permission denied
1条答案
按热度按时间vwkv1x7d1#
client_keys
必须是列表,指向私钥文件!从文档:
用于通过基于主机的身份验证对此客户端进行身份验证的密钥列表。最简单的选择是传递要从中读取一个或多个私钥的文件的名称。
关于所有选项的更多信息可以在这里和这里找到。
下面是更新后的代码:
在我看来,
asyncssh.connect
(以及作为SSHCluster
的扩展)的用户体验和错误管理在这方面可以做得更好。