使用ipcluster从Linux连接到带有EPD的OS X服务器? [英] Using ipcluster to connect to an OS X server w/ EPD from Linux?

查看:293
本文介绍了使用ipcluster从Linux连接到带有EPD的OS X服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用IPython.parallel对SSH的支持,以允许我的Linux客户端从安装了EPD64的OS X服务器上运行远程 ipengine 。但是,这会失败,因为它尝试使用我的本地计算机找出在远程主机上运行的正确命令,该主机在其他位置具有 ipengineapp 包。如何修改 ipcluster_config.py 以识别差异?

I am trying to use IPython.parallel's support for SSH to allow my Linux client to run remote ipengines from an OS X server that has EPD64 installed. This fails, however, as it attempts to use my local machine to figure out the right command to run on the remote host, which has its ipengineapp package in a different location. How do I modify ipcluster_config.py to recognize the difference?

具体来说,当我在远程主机上运行 ipcluster start --log-level = DEBUG 时,我得到了控制台输出告诉我包含如下所示的行:

Concretely, when I run ipcluster start --log-level=DEBUG on the remote host, I get console output telling me that contains a line like the following:

[IPClusterStart] Starting LocalEngineLauncher: ['/Library/Frameworks/EPD64.framework/Versions/7.3/bin/python', '-c', 'from IPython.parallel.apps.ipengineapp import launch_new_instance; launch_new_instance()', '--profile-dir', u'/Users/username/.ipython/profile_default', '--cluster-id', u'', '--log-to-file', '--log-level=20']

另一方面,从本地机器运行时带 ipcluster start --log-level = DEBUG ,我得到以下代码,适用于Linux主机:

On the other hand, when run from my local machine with ipcluster start --log-level=DEBUG, I get the following line, as would be appropriate for a Linux host:

[IPClusterStart] Starting SSHEngineLauncher: ['ssh', '-tt', u'hostname', '/usr/bin/python', u'/usr/lib/python2.7/site-packages/IPython/parallel/apps/ipengineapp.py', '--profile-dir', u'/home/username/.ipython/profile_ssh', '--log-to-file', '--log-level=20']

我的 ipcluster_config.py 对于这个例子是:

c = get_config()
c.IPClusterEngines.engine_launcher_class = 'SSHEngineSetLauncher'
c.IPClusterStart.controller_launcher_class = 'SSHControllerLauncher'

c.SSHEngineSetLauncher.engines = {
    'hostname1': 12,
    'hostname2': 12,
}


推荐答案

我认为这在0.14有所改进,但你要找的配置值是 SSHEngineSetLauncher.engine_cmd
在ipcluster_config.py中编辑,所以它类似于:

I think this is improved in 0.14, but the config value you are looking for is SSHEngineSetLauncher.engine_cmd. Edit this in ipcluster_config.py, so it's something like:

c.SSHEngineSetLauncher.engine_cmd = ['/path/to/your/python', '-c', 'from IPython.parallel.apps.ipengineapp import launch_new_instance; launch_new_instance()']

或者,有时甚至是最简单的东西,只要你的PATH配置好了在一个简单的ssh会话中:

or, sometimes even the simplest thing works, as long as your PATH is configured in a simple ssh session:

c.SSHEngineSetLauncher.engine_cmd = ['ipengine']

这篇关于使用ipcluster从Linux连接到带有EPD的OS X服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆