使用API​​启动调度程序时无法启动Dask仪表板 [英] Dask dashboard not starting when starting scheduler with api

查看:172
本文介绍了使用API​​启动调度程序时无法启动Dask仪表板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用dask建立了一个分布式系统.当我使用 Python API ,那么调度程序不会提及启动仪表板.如预期的那样,我无法在我希望的地址上到达它.

I've set up a distributed system using dask. When I start the scheduler using the Python API, the dask scheduler doesn't mention starting the dashboard. As expected, I can not reach it on the address I would expect it to be.

由于安装了bokeh,我希望仪表板能够启动.但是,当我使用命令行启动调度程序时,仪表板会正确启动.为什么通过python API启动调度程序不会启动仪表板?

Since bokeh is installed, I'd expect the dashboard to be started. When I start the scheduler using the command line however, the dashboard starts correctly. Why is it that starting the scheduler through the python api does not start the dashboard?

相关信息:

  • python 3.6.7
  • 任务1.0.0
  • dask-glm 0.2.0
  • dask-ml 0.11.0
  • 分布式1.25.1
  • 散景1.0.3
  • 龙卷风5.1.1(也曾在4.5中试用过)

输出调度程序(通过python API):

Output scheduler (via python api):

orval$ python3 myscheduler.py
distributed.scheduler - INFO - Clear task state
distributed.scheduler - INFO -   Scheduler at:    tcp://10.33.14.65:8786

代码myscheduler.py:

Code myscheduler.py:

from distributed import Scheduler
from tornado.ioloop import IOLoop
from threading import Thread
s = Scheduler()
s.start('tcp://:8786')   # Listen on TCP port 8786
loop = IOLoop.current()
loop.start()

通过命令行启动调度程序:

Starting the scheduler through the command line:

distributed.scheduler - INFO - -----------------------------------------------
distributed.scheduler - INFO - Clear task state
distributed.scheduler - INFO -   Scheduler at:    tcp://10.33.14.65:8786
distributed.scheduler - INFO -       bokeh at:                     :8787
distributed.scheduler - INFO - Local Directory:    /tmp/scheduler-pg2wz3cg
distributed.scheduler - INFO - -----------------------------------------------

推荐答案

首先,即使在python进程中启动调度程序,您也可能希望考虑使用LocalCluster:

Firstly, even when starting the scheduler within a python process, you may wish to consider using LocalCluster:

cluster = dask.distributed.LocalCluster(processes=False, n_workers=0)

您可以通过cluster.scheduler到达调度程序,并且cluster.scheduler.services包含散景".

where you can reach the scheduler as cluster.scheduler, and cluster.scheduler.services includes "bokeh".

要直接实例化,您需要指定services=关键字以包含Bokeh仪表板插件.要实例化的类是distributed.bokeh.scheduler.BokehScheduler,类似

For instantiating directly as you are doing, you would need to specify the services= keyword to include the Bokeh dashboard plugin. The class to instantiate is distributed.bokeh.scheduler.BokehScheduler, something like

services={('bokeh', diagnostics_port): (BokehScheduler, {})}

是否要对已创建的循环和线程做一些特别的事情?在这种情况下,也许您可​​以更详细地说明要实现的目标.

Were you wanting to do something particular with the loop and thread you have created? Perhaps, in that case, you can be more specific about what you want to achieve.

这篇关于使用API​​启动调度程序时无法启动Dask仪表板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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