使用SSH的IPython集群

时间:2016-11-06 10:48:54

标签: python ipython jupyter-notebook ipython-parallel

在远程计算机上启动群集时遇到问题。当“手动”启动集群并复制json配置文件时,一切正常。我可以连接笔记本电脑,一切都按预期工作。

但我希望能够通过SSH启动集群。

  • Host2(2个引擎)
  • Host1(Controller + 2引擎)
  • 笔记本电脑 - 笔记本

笔记本

ipython profile create --parallel --profile=ssh

ipcluster_config.py

c.IPClusterEngines.engine_launcher_class = 'SSHEngineSetLauncher'
c.IPClusterStart.controller_launcher_class = 'SSHControllerLauncher'


c.SSHControllerLauncher.hostname = 'host1'
c.SSHControllerLauncher.user = 'root'
c.SSHControllerLauncher.controller_args = ['--reuse', '--ip=*', '--profile-dir=/root/.ipython/profile_ssh']
c.SSHEngineSetLauncher.engines = {"host1":2, "host2":2}

启动笔记本

jupyter notebook --debug

从ipython群集标签启动笔记本群集时。引擎连接到控制器,文件被复制等。但是当我尝试连接笔记本时

import ipyparallel as ipp
c = ipp.Client(profile='ssh',debug=True)
c.ids
c[:].apply_sync(lambda : "Hello, World")

“TimeoutError: Hub connection request timed out”

从控制台日志中我可以看到引擎正在运行并成功连接。

0 个答案:

没有答案