Debian Codegraph @

cmd/clustersh/README

raw
1 clustersh
2
3 This is a program to run commands and transfer files between multiple
4 servers over SSH.
5
6 [ Usage ]
7 clustersh [-a addresses] [-c chunk] [-h] [-u user] command args
8
9 [ Flags ]
10
11 -a addresses The comma-separated list of servers to send
12 to. There must not be any spaces in this list.
13
14 -c chunk The size of chunks to transfer, in bytes. The
15 default is 16MB.
16
17 -u user The SSH username to use. It must be the
18 same for all hosts. Defaults to the value
19 of the USER environment variable.
20
21 [ Commands ]
22
23 exec, run: run a command on the servers
24 The args list must be the command line to send to the hosts.
25
26 upload, up, push, send: upload a file to the servers
27 The first argument is the local file to upload, and the second
28 is the filename to store it as on the remote.
29
30 download, down, pull, fetch: download a file from the servers
31 The first argument is the filename to fetch.The second argument
32 is the base name for the local file. It will have a '-' and the
33 hostname appended.
34
35 [ Examples ]
36
37 Tailing syslog on the hosts "mesos-01," "mesos-02," and "mesos-03"
38 with the same username as the logged in user:
39
40 $ clustersh -a mesos-01,mesos-02,mesos-03 tail /var/log/syslog
41 2015/12/22 20:37:17 waiting for sessions to complete
42 [mesos-02] Dec 22 23:37:20 mesos-02 chronos[1848]: [2015-12-22 23:37:20,325] INFO Declined unused offers with filter refuseSeconds=5.0 (use --decline_offer_duration to reconfigure) (org.apache.mesos.chronos.scheduler.mesos.MesosJobFramework:97)
43 [mesos-02] Dec 22 23:37:20 mesos-02 mesos-master[534]: I1222 23:37:20.326491 612 master.cpp:3297] Processing DECLINE call for offers: [ 07e0c918-efa9-48c3-9851-77abf0c95f92-O61048 ] for framework 07e0c918-efa9-48c3-9851-77abf0c95f92-0001 (chronos-2.4.0) at [email protected]:48192
44 [mesos-02] Dec 22 23:37:20 mesos-02 mesos-master[534]: I1222 23:37:20.326786 612 hierarchical.cpp:744] Recovered cpus(*):1; mem(*):497; disk(*):14910; ports(*):[31000-32000] (total: cpus(*):1; mem(*):497; disk(*):14910; ports(*):[31000-32000], allocated: ) on slave 07e0c918-efa9-48c3-9851-77abf0c95f92-S78 from framework 07e0c918-efa9-48c3-9851-77abf0c95f92-0001
45 [mesos-01] Dec 22 23:37:19 mesos-01 marathon[1719]: [2015-12-22 23:37:19,045] INFO 73.189.108.122 - - [23/Dec/2015:04:37:19 +0000] "GET //mesos-01:8080/v2/deployments HTTP/1.1" 200 2 "http://mesos-01:8080/ui/" "Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 Iceweasel/43.0" (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$f7252a53:qtp643328884-33)
46 [mesos-01] Dec 22 23:37:19 mesos-01 marathon[1719]: [2015-12-22 23:37:19,047] INFO 73.189.108.122 - - [23/Dec/2015:04:37:19 +0000] "GET //mesos-01:8080/v2/apps HTTP/1.1" 200 11 "http://mesos-01:8080/ui/" "Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 Iceweasel/43.0" (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$f7252a53:qtp643328884-27)
47 [mesos-01] Dec 22 23:37:19 mesos-01 marathon[1719]: [2015-12-22 23:37:19,048] INFO 73.189.108.122 - - [23/Dec/2015:04:37:19 +0000] "GET //mesos-01:8080/v2/queue HTTP/1.1" 200 12 "http://mesos-01:8080/ui/" "Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 Iceweasel/43.0" 1 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$f7252a53:qtp643328884-29)
48 [mesos-03] Dec 22 23:35:09 mesos-03 mesos-slave[2675]: I1222 23:35:09.231684 2692 slave.cpp:4039] Current disk usage 8.93%. Max allowed age: 5.674993196753403days
49 [mesos-03] Dec 22 23:36:09 mesos-03 mesos-slave[2675]: I1222 23:36:09.232365 2694 slave.cpp:4039] Current disk usage 8.93%. Max allowed age: 5.674993196753403days
50 [mesos-03] Dec 22 23:37:09 mesos-03 mesos-slave[2675]: I1222 23:37:09.232836 2691 slave.cpp:4039] Current disk usage 8.93%. Max allowed age: 5.674993196753403days
51
52 Transferring the `clustersh` program to the same three hosts:
53
54 $ clustersh -a mesos-01,mesos-02,mesos-03 push clustersh clustersh
55 2015/12/22 20:39:23 waiting for sessions to complete
56 [mesos-02] wrote 6422688-byte chunk
57 [mesos-02] clustersh uploaded to clustersh
58 [mesos-03] wrote 6422688-byte chunk
59 [mesos-03] clustersh uploaded to clustersh
60 [mesos-01] wrote 6422688-byte chunk
61 [mesos-01] clustersh uploaded to clustersh
62
63 Copying the `/var/log/mesos/marathon.log` file from each of the three hosts:
64
65 $ clustersh -a mesos-01,mesos-02,mesos-03 fetch /var/log/mesos/marathon.log marathon.log
66 2015/12/22 20:42:28 waiting for sessions to complete
67 [mesos-02] wrote 467461-byte chunk
68 [mesos-02] /var/log/mesos/marathon.log downloaded to marathon.log-mesos-02
69 [mesos-03] wrote 415850-byte chunk
70 [mesos-03] /var/log/mesos/marathon.log downloaded to marathon.log-mesos-03
71 [mesos-01] wrote 2940327-byte chunk
72 [mesos-01] /var/log/mesos/marathon.log downloaded to marathon.log-mesos-01
73 $ ls -1 marathon.log*
74 marathon.log-mesos-01
75 marathon.log-mesos-02
76 marathon.log-mesos-03
77