Cannot connect to remote ipcluster - TimeoutError

I have ipcluster running on a remote Linux server, and I connect remotely from a PC with MS Windows. The server is not visible from the outside, so I need to connect using ssh tunnels through another machine, which I defined in the json file. However, many attempts (and kernel reboots) are necessary for a successful connection, usually I get a 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 

Also, after connecting after some time of inactivity (~ 15 minutes), the connection seems to die, and if I issue some command that should talk to the cluster (for example, rc.queue_status ()), the entire ipython session will respond to requests.

I did not find anything useful in the server logs, I always see that the initial connection is established and closed, and if successful, additional connections open when various ssh tunnels are created (?).

Are there certain settings (sshd_config) that need to be configured on the linux ssh server? How can I keep the connection alive (or reconnect)? Thanks.

+6
source share

Source: https://habr.com/ru/post/917102/


All Articles