[ https://issues.apache.org/jira/browse/CASSANDRA-2607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028888#comment-13028888 ]
Brandon Williams edited comment on CASSANDRA-2607 at 5/4/11 6:53 PM: --------------------------------------------------------------------- +1 You can also automate getting the list of hosts, so long as hostname points to the interface jmx is bound to: {noformat} for host in `nodetool -h \`hostname\` ring | grep -v Address | cut -f1 -d' '`; do nodetool -h $host command; done {noformat} was (Author: brandon.williams): +1 You can also automate getting the list of hosts, so long as hostname points to the interface jmx is bound to: {noformat} for host in `nodetool -h \`hostname\` ring | grep -v Address | cut -f1 -d' '`; do bin/nodetool -h $host command; done {noformat} > remove clustertool > ------------------ > > Key: CASSANDRA-2607 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2607 > Project: Cassandra > Issue Type: Task > Components: Tools > Reporter: Jonathan Ellis > Priority: Minor > Fix For: 1.0 > > > Clustertool is a "run an operation against the whole cluster" tool, as > opposed to nodetool which is single-node. > Clustertool never achieved feature parity with nodetool and never will for > long, since it has to be manually updated for each operation type. > Since it's trivial to just use standard tools to run nodetool against an > entire cluster, let's drop clustertool in favor of encouraging that. > Some examples. The first two assume a file "clustermembers" with your > cluster host names; dsh will want that in /etc/dsh/groups instead of cwd. > bash: > {noformat} > for host in `cat clustermembers`; do nodetool -h $host command;done > {noformat} > xargs: > {noformat} > # one op at a time > cat clustermembers | xargs -n 1 -I{} nodetool -h {} command > # parallelize > cat clustermembers | xargs -P `wc -l clustermembers` -n 1 -I{} nodetool -h {} > command > {noformat} > dsh: > {noformat} > # one at a time > dsh -g clustermembers -- nodetool -h localhost command > # parallelize > dsh -g -c clustermembers -- nodetool -h localhost command > {noformat} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira