scripts/cluster/README

79 lines
2.3 KiB
Plaintext
Raw Normal View History

2013-04-29 22:43:41 +02:00
The cluster utilities are script allowing to work in parallel with a
number of remote hosts, using utilities such as Parallel SSH (pssh) or
fping. They all take as first and mandatory positional argument a host
list name “NAME”; the list will be searched according to the following
pattern:
2013-04-29 22:43:41 +02:00
``` $XDG_CONFIG_HOME/cluster/NAME.lst
2013-04-29 22:43:41 +02:00
($XDG_CONFIG_HOME being equivalent to $HOME/.config if unset.)
2013-04-29 22:43:41 +02:00
For example, one can call the cluster-ping.sh script typing:
``` cluster-ping my_hosts
to use the hosts' file $XDG_CONFIG_HOME/cluster/my_hosts.lst
2013-04-29 22:43:41 +02:00
The format of such a .lst file is one line per host name or IP address,
for example:
```
192.168.42.1
192.168.42.3
priam
```
2017-09-22 22:44:57 +02:00
The scripts based on SSH use the local user's login name as remote login;
this can be changed using the ``-l`` option, that must appear before the
hosts' list on the command line, for example:
``` cluster-run -l root openwrt_machines opkg install screen
The provided scripts are detailed in the sequel.
2013-04-29 22:43:41 +02:00
= cluster-ping.sh =
Test the connectivity with the hosts of the list by sending them a ICMP
echo packet.
Dependency: fping
= cluster-ssh.sh =
Open a GNU Screen tab with an interactive SSH session for each host of
the hosts' list. Must be run inside of an existing Screen.
Dependencies: screen, ssh
= cluster-run.sh =
Run the same command on every host of the hosts' list.
Dependency: parallel-ssh (pssh)
= cluster-deploy.sh =
Deploy one or more files in parallel on every host of the hosts' list.
The files are copied in the remote user's home directory.
2017-09-22 22:44:57 +02:00
By default, the files are transferred one by one, to make sure you notice
the errors for each file (bad permissions, out of space, etc.), but you
can use the -P switch to transfer them all at once (faster).
2013-04-29 22:43:41 +02:00
While it is possible to transfer directories with the default option, to
synchronise directories one would rather use the -r option, that uses
prsync rather than pscp to transfer the files. With the -R option, the
remote files that are not in the local copy will be deleted (rsync's
2017-09-22 22:44:57 +02:00
--delete option). In both cases, the transfer is done with rsync's -a
(archive) option.
Please note that unlike rsync, prsync cannot handle multiple local
files, therefore the -P option is ignored when passed along with -r or
-R.
Dependencies: parallel-scp (pscp), parallel-rsync (prsync), cluster-ping
(see above)