如何在一台机器上设置两个 dask 分布式调度器?

How to set up two dask distributed schedulers on one machine?

我想在同一台机器上安装两个 dask 分布式调度程序 运行。

第二个调度程序用于测试目的,我试图通过在 IPython 笔记本中调用 distributed.Client() 来启动调度程序及其工作程序。但是,如果我这样做,我无法弄清楚如何访问第二个调度程序的散景服务器。调用 scheduler_info() 表示散景服务器可能不是 运行。

我应该如何设置这两个调度程序?

使用不带参数的 Client() 是在您的个人计算机上设置本地 "cluster" 以进行简短交互会话的便捷方式。如果您想以更彻底的方式设置 dask 调度程序,您可能想尝试 dask.distributed.LocalCluster or the dask-scheduler command line utility. See documentation for How to set up a dask.distributed network

您可以通过传递 --help

查看可用的选项
(py35) mrocklin@workstation:~$ dask-scheduler --help
Usage: dask-scheduler [OPTIONS]

Options:
  --port INTEGER                 Serving port
  --http-port INTEGER            HTTP port
  --bokeh-port INTEGER           Bokeh port
  --bokeh-internal-port INTEGER  Internal Bokeh port
  --bokeh / --no-bokeh           Launch Bokeh Web UI  [default: True]
  --host TEXT                    IP, hostname or URI of this server
  --show / --no-show             Show web UI
  --bokeh-whitelist TEXT         IP addresses to whitelist for bokeh.
  --prefix TEXT                  Prefix for the bokeh app
  --use-xheaders BOOLEAN         User xheaders in bokeh app for ssl
                                 termination in header  [default: False]
  --pid-file TEXT                File to write the process PID
  --scheduler-file TEXT          File to write connection information. This
                                 may be a good way to share connection
                                 information if your cluster is on a shared
                                 network file system.
  --help                         Show this message and exit.

为确保同一台机器上的两个调度程序之间没有任何冲突,您需要适当地设置端口。

dask-scheduler --port XXXX --bokeh-port XXXX --bokeh-internal-port XXXX