Ipython 无法连接到远程ipcluster-TimeoutError

Ipython 无法连接到远程ipcluster-TimeoutError,ipython,Ipython,我在远程linux服务器上运行ipcluster,并从MS Windows PC远程连接。从外部看不到该服务器,因此我需要通过json文件中定义的其他机器使用ssh隧道进行连接。然而,需要多次尝试(以及内核重启)才能成功连接,通常会出现TimeoutError rc=Client("ipcontroller_client.json", sshkey="key.txt") C:\Local\Python27\lib\site-packages\IPython\parallel\client\cl

我在远程linux服务器上运行ipcluster,并从MS Windows PC远程连接。从外部看不到该服务器,因此我需要通过json文件中定义的其他机器使用ssh隧道进行连接。然而,需要多次尝试(以及内核重启)才能成功连接,通常会出现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
此外,一旦连接,经过一定时间的不活动(约15分钟)后,连接似乎会终止,如果我发出一些需要与集群对话的命令(例如,rc.queue_status()),整个ipython会话将变得无响应

我在服务器日志中没有发现任何有用的内容,我总是可以看到初始连接已建立并关闭,如果成功,则在创建各种ssh隧道(?)时打开其他连接


在linux ssh服务器上是否有一些特定的设置(sshd_config)需要调整?如何使连接保持活动状态(或重新连接)?谢谢。

您可能是第一个尝试从Windows通过ssh隧道连接到群集的用户,因此可能存在错误。您应该检查进程,以查看通道是否处于活动状态。这可能是因为无法正确使用paramiko建造隧道。