我在远程linux服务器上运行ipcluster,并从MS Windows PC远程连接.从外面看不到服务器,所以我需要使用ssh隧道通过我在json文件中定义的其他机器进行连接.但是,成功连接需要很多尝试(和内核重启),通常我会得到TimeoutError
rc=Client("ipcontroller_client.json", sshkey="key.txt")
C:\Local\Python27\lib\site-packages\IPython\parallel\client\client.py in __init__(self, url_or_file, profile, profile_dir, ipython_dir, context, debug, exec_key, sshserver, sshkey, password, paramiko, timeout, **extra_args)
384 self._queue_handlers = {'execute_reply' : self._handle_execute_reply,
385 'apply_reply' : self._handle_apply_reply}
--> 386 self._connect(sshserver, ssh_kwargs, timeout)
387
388 def __del__(self):
C:\Local\Python27\lib\site-packages\IPython\parallel\client\client.py in _connect(self, sshserver, ssh_kwargs, timeout)
488 evts = poller.poll(timeout*1000)
489 if not evts:
--> 490 raise error.TimeoutError("Hub connection request timed out")
491 idents,msg = self.session.recv(self._query_socket,mode=0)
492 if self.debug:
TimeoutError: Hub connection request timed out
Run Code Online (Sandbox Code Playgroud)
此外,一旦连接,在一段时间不活动(约15分钟)后连接似乎死亡,如果我发出一些需要与群集通信的命令(例如,rc.queue_status()),整个ipython会话变得没有响应.
我没有在服务器日志中找到任何有用的东西,我总能看到建立和关闭的初始连接,并且在成功的情况下,在创建各种ssh隧道(?)时打开其他连接.
是否需要在linux ssh服务器上调整某些特定设置(sshd_config)?如何保持连接活动(或重新连接)?谢谢.
| 归档时间: |
|
| 查看次数: |
929 次 |
| 最近记录: |