如何在没有 ipcluster 命令的情况下停止 IPython 集群

How to stop an IPython cluster without the ipcluster command

我不使用 ipcluster 命令启动我的 IPython 集群,而是使用单独的命令 ipcontrolleripengine,因为我在网络上使用多台机器。使用 ipcluster 命令启动集群时,停止集群非常简单:

ipcluster stop

但是,我一直没能找到单独使用各个命令的过程。

感谢您的帮助

最简单的方法是连接客户端并发出关闭命令:

import ipyparallel as ipp
c = ipp.Client()
c.shutdown(hub=True)

Client.shutdown() 关闭引擎;添加 hub=True 告诉它也关闭中央控制器进程。