Local Dask worker unable to connect to local sched

2019-08-22 06:55发布

问题:

While running Dask 0.16.0 on OSX 10.12.6 I'm unable to connect a local dask-worker to a local dask-scheduler. I simply want to follow the official Dask tutorial. Steps to reproduce:

Step 1: run dask-scheduler

Step 2: Run dask-worker 10.160.39.103:8786

The problem seems to related to the dask scheduler and not the worker, as I'm not even able to access the port by other means (e.g., nc -zv 10.160.39.103 8786).

However, the process is clearly still running on the machine:

回答1:

My first guess is that due to network rules your computer may not accept network connections that look like they're coming from the outside world. You might want to try using dask-worker localhost:8786 and see if that works instead.

Also, as a reminder, you can always start a scheduler and worker directly from Python without creating dask-scheduler and dask-worker processes

from dask.distributed import Client
# client = Client('scheduler-address:8786')
client = Client()  # create scheduler and worker automatically

As a foolproof method you can also pass processes=False which will avoid networking issues entirely

client = Client(processes=False)