Debian Codegraph @

docs/source/deploying-ssh.rst

raw
1 SSH
2 ===
3
4 It is easy to set up Dask on informally managed networks of machines using SSH.
5 This can be done manually using SSH and the
6 Dask :doc:`command line interface <deploying-cli>`,
7 or automatically using either the :class:`dask.distributed.SSHCluster` Python *cluster manager* or the
8 ``dask-ssh`` command line tool. This document describes both of these options.
9
10 .. note::
11 Before instaniating a ``SSHCluster`` it is recommended to configure keyless SSH
12 for your local machine and other machines. For example, on a Mac to SSH into
13 localhost (local machine) you need to ensure the Remote Login option is set in
14 System Preferences -> Sharing. In addition, ``id_rsa.pub`` should be in
15 ``authorized_keys`` for keyless login.
16
17 Python Interface
18 ----------------
19
20 .. currentmodule:: dask.distributed
21
22 .. autofunction:: SSHCluster
23
24 Command Line
25 ------------
26
27 The convenience script ``dask-ssh`` opens several SSH connections to your
28 target computers and initializes the network accordingly. You can
29 give it a list of hostnames or IP addresses::
30
31 $ dask-ssh 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4
32
33 Or you can use normal UNIX grouping::
34
35 $ dask-ssh 192.168.0.{1,2,3,4}
36
37 Or you can specify a hostfile that includes a list of hosts::
38
39 $ cat hostfile.txt
40 192.168.0.1
41 192.168.0.2
42 192.168.0.3
43 192.168.0.4
44
45 $ dask-ssh --hostfile hostfile.txt
46
47 .. note::
48
49 The command line documentation here may differ depending on your installed
50 version. We recommend referring to the output of ``dask-ssh --help``.
51
52 .. click:: distributed.cli.dask_ssh:main
53 :prog: dask-ssh
54 :show-nested: