建立ipython集群

  1. 启动controller

    ipcontroller -- ip = ipaddress

  2. 设置ssh免登陆

    因为需要分发文件,采用ssh通信,所以需要配置ssh免登陆

  3. 分发配置文件

    scp controller.host:.ipython/profile_default/security/ipcontroller-engine.json ./

  4. 使用配置文件开启engine

        ipengine --profile --file=./ipcontroller-engine.json

    注意:

        (1)可以避免每次重新连接ipcontroller,只需要加上命令参数--reuse.即:

        ipengine --reuse

        (2)如果将文件直接分发至engine目录下的安全路径之中,就无需指定配置文件路劲,只需要指定连接方式是ssh即可.也就是说,分发配置文件操作改为这样:  scp controller.host:.ipython/profile_default/security/ipcontroller-engine.json ~/.ipython/profile_ssh/security/

        ipengine --profile=ssh

        (3)因为每次重新启动ipcontroller都需要重新分发配置文件,十分复杂.我们可以在下次启动ipcontroller的时候,命令参数改为 --reuse,这样ipcontroller就会自动续用上次生成的ipcontroller-engine.json文件.这样我们以后无论重启ipcontroller和engine多少次,都无需进行重复配置了.所以正确的重启ipcontroller命令如下:

        ipcontroller -- reuse

一些知识点:

  1. 日志文件目录

    日志文件能够帮助我们进行debug,日志文件的路径为

        IPYTHONDIR/profile_<name>/log

    2.ipcontroller配置文件

        IPython Controller 每次都从ipcontroller_config.py  读取配置文件 .该配置文件在active profile directory. Google查找告诉我们,一般在路径~/.ipython/profile_default 下













posted @ 2015-12-29 23:16  ZHOU YANG  阅读(716)  评论(0编辑  收藏  举报