@@ -5,42 +5,116 @@ Cluster management tools for [Apache Cassandra](http://cassandra.apache.org).
55
66The tools
77---------
8- * ` c-any-nt <arg> [arg ...] `
98
10- Execute nodetool on an instance (any instance).
11-
12- * ` c-cqlsh <id> `
13-
14- Execute ` cqlsh ` on an instance (uses the cqlshrc file in the instance's
15- configuration directory).
16-
17- * ` c-foreach-nt <arg> [arg ...] `
18-
19- Iteratively execute nodetool on all local Cassandra instances.
20-
21- * ` c-foreach-restart [-r RETRIES] [-d DELAY] [--execute-post-shutdown CMD] `
22-
23- Iteratively restart Cassandra instances.
24-
25- Each instance is drained prior to being restarted. After each restart, the
26- process will block until the CQL port opens up.
27-
28- Any command specified using ` --execute-post-shutdown ` will be executed after
29- Cassandra is shutdown, and before it is restarted. Commands can include the
30- ` {id} ` template which will be substituted with the instance being restarted
31- before executing the command.
32-
33- * ` c-ls `
34-
35- List the locally configured instance IDs.
36-
37- * ` streams [--nodetool CMD] `
38-
39- Realtime console monitoring of streaming operations.
40-
41- * ` uyaml <yaml file> <attribute> `
42-
43- Query attributes from a yaml file.
9+ ### c-cqlsh
10+ #### Synopsis
11+ ` c-cqlsh <id> `
12+ #### Description
13+ Given an instance ID, executes ` cqlsh ` on that instance. Uses the the ` cqlshrc ` file located in the instance's configuration directory.
14+ #### Example
15+ $ c-cqlsh a
16+ Connected to services-test at 10.64.0.202:9042.
17+ [cqlsh 5.0.1 | Cassandra 2.2.6 | CQL spec 3.3.1 | Native protocol v4]
18+ Use HELP for help.
19+ cassandra@cqlsh>
20+
21+ ### c-any-nt
22+ #### Synopsis
23+ ` c-any-nt <arg> [arg ...] `
24+ #### Description
25+ In a WMF multi-instance environment, executes nodetool on a randomly chosen instance (any instance).
26+ #### Example
27+ $ c-any-nt status -r
28+ ...
29+
30+ ### c-foreach-nt
31+ #### Synopsis
32+ ` c-foreach-nt <arg> [arg ...] `
33+ #### Description
34+ In a WMF multi-instance environment, iteratively execute nodetool on all local Cassandra instances.
35+ #### Example
36+ $ c-foreach-nt version
37+ a: ReleaseVersion: 2.2.6
38+ b: ReleaseVersion: 2.2.6
39+
40+ ### c-foreach-restart
41+ #### Synopsis
42+ c-foreach-restart [-h] [-r RETRIES] [-d DELAY] [--execute-post-shutdown CMD]
43+
44+ Cassandra instance restarter.
45+
46+ optional arguments:
47+ -h, --help show this help message and exit
48+ -r RETRIES, --retries RETRIES
49+ Maximum number of times to check if service is up.
50+ -d DELAY, --delay DELAY
51+ Number seconds between connection attempts, in
52+ seconds.
53+ --execute-post-shutdown CMD
54+ Command to execute after Cassandra has been shutdown,
55+ and before it is started back up.
56+
57+ #### Description
58+ In a WMF multi-instance environment, iteratively restart instances.
59+
60+ Each instance is drained prior to being restarted. After each restart, the process blocks
61+ until the CQL port is listening.
62+
63+ Commands specified by ` --execute-post-shutdown ` can include the ` {id} ` template which will
64+ be substituted with the ID of the instance being restarted.
65+ #### Example
66+ $ sudo c-foreach-restart --execute-post-shutdown="echo '{id} is a teapot, short and stout'"
67+ ...
68+
69+ ### c-ls
70+ #### Synopsis
71+ ` c-ls `
72+ #### Description
73+ List the IDs of the locally configured instance IDs.
74+ #### Example
75+ $ c-ls
76+ a
77+ b
78+ c
79+
80+ ### streams
81+ #### Synopsis
82+ streams [-h] [-nt CMD]
83+
84+ Cassandra streams monitor
85+
86+ optional arguments:
87+ -h, --help show this help message and exit
88+ -nt CMD, --nodetool CMD
89+ Nodetool command to use
90+
91+ #### Description
92+ Realtime console monitoring of streaming operations.
93+ #### Example
94+ $ streams -nt nodetool-b
95+
96+ ### uyaml
97+ #### Synopsis
98+ uyaml [-h] yaml path
99+
100+ YAML parser
101+
102+ positional arguments:
103+ yaml YAML file to parse
104+ path Path to parse from file
105+
106+ optional arguments:
107+ -h, --help show this help message and exit
108+
109+ #### Description
110+ Query attributes from a YAML file.
111+ #### Example
112+ $ uyaml /etc/cassandra-instances.d/restbase1007-a.yaml /jmx_port
113+ 7189
114+ $ for i in `c-ls`; do uyaml /etc/cassandra-instances.d/restbase1007-$i.yaml /jmx_port; done
115+ 7189
116+ 7190
117+ 7191
44118
45119
46120Building a Debian package
0 commit comments