from distributed import Client, LocalCluster
cluster = LocalCluster()
Is there any way to override the default port address ?
The keyword scheduler_port would probably solve your issue? Here is the current docstring. Does it suffice?
class LocalCluster(object):
""" Create local Scheduler and Workers
This creates a "cluster" of a scheduler and workers running on the local
machine.
Parameters
----------
n_workers: int
Number of workers to start
threads_per_worker: int
Number of threads per each worker
nanny: boolean
If true start the workers in separate processes managed by a nanny.
If False keep the workers in the main calling process
scheduler_port: int
Port of the scheduler. 8786 by default, use 0 to choose a random port
silence_logs: logging level
Level of logs to print out to stdout. ``logging.CRITICAL`` by default.
Use a falsey value like False or None for no change.
kwargs: dict
Extra worker arguments, will be passed to the Worker constructor.
Examples
--------
>>> c = LocalCluster() # Create a local cluster with as many workers as cores # doctest: +SKIP
>>> c # doctest: +SKIP
LocalCluster("127.0.0.1:8786", workers=8, ncores=8)
>>> c = Client(c) # connect to local cluster # doctest: +SKIP
Add a new worker to the cluster
>>> w = c.start_worker(ncores=2) # doctest: +SKIP
Shut down the extra worker
>>> c.remove_worker(w) # doctest: +SKIP
Start a diagnostic web server and open a new browser tab
>>> c.start_diagnostics_server(show=True) # doctest: +SKIP
"""
Probably mention this in ReadMe ?
The readme is currently very concise. Currently I don't think that the solution for this particular issue should live there.
Atleast it would help all the rambling for a simple issue. Everyone is not that kind of expert to check the docstring anywhere lying in the code.
I think that it's a question of how common this issue is relative to all other issues. I think that if we include all solutions like this in the README then the README will become long enough that only experts will read it. To find solutions for more specific problems it is probably necessary for users to search a little bit through documentation or docstrings.
Fortunately, people are also used to searching online and so, because you were kind enough to write up the problem, perhaps others will come across this github issue in the future when they run into the same problem.
@mrocklin @anweshknayak Github issues are kind of documentations 馃槣
Most helpful comment
I think that it's a question of how common this issue is relative to all other issues. I think that if we include all solutions like this in the README then the README will become long enough that only experts will read it. To find solutions for more specific problems it is probably necessary for users to search a little bit through documentation or docstrings.
Fortunately, people are also used to searching online and so, because you were kind enough to write up the problem, perhaps others will come across this github issue in the future when they run into the same problem.