リモートの 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) はありますか? 接続を維持する (または再接続する) にはどうすればよいですか? ありがとうございました。