Skip to content

Commit bbd67ed

Browse files
Mark Allenandrewjstone
authored andcommitted
Add new cluster commands to riak-admin
Depends on basho/riak_core#659
1 parent f84a3a6 commit bbd67ed

File tree

1 file changed

+50
-14
lines changed

1 file changed

+50
-14
lines changed

rel/files/riak-admin

Lines changed: 50 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,19 @@ cluster_admin()
304304
node_up_check
305305
$NODETOOL rpc riak_core_console clear_staged
306306
;;
307+
status)
308+
node_up_check
309+
$NODETOOL rpc riak_core_console command $SCRIPT cluster status
310+
;;
311+
partitions|members|partition)
312+
node_up_check
313+
$NODETOOL rpc riak_core_console command $SCRIPT cluster $@
314+
;;
315+
partition[_-]count)
316+
node_up_check
317+
shift
318+
$NODETOOL rpc riak_core_console command $SCRIPT cluster partition-count $@
319+
;;
307320
*)
308321
echo "\
309322
Usage: $SCRIPT cluster <command>
@@ -312,25 +325,48 @@ The following commands stage changes to cluster membership. These commands
312325
do not take effect immediately. After staging a set of changes, the staged
313326
plan must be committed to take effect:
314327
315-
join <node> Join node to the cluster containing <node>
316-
leave Have this node leave the cluster and shutdown
317-
leave <node> Have <node> leave the cluster and shutdown
328+
join <node> Join node to the cluster containing <node>
329+
leave Have this node leave the cluster and shutdown
330+
leave <node> Have <node> leave the cluster and shutdown
318331
319-
force-remove <node> Remove <node> from the cluster without
320-
first handing off data. Designed for
321-
crashed, unrecoverable nodes
332+
force-remove <node> Remove <node> from the cluster without
333+
first handing off data. Designed for
334+
crashed, unrecoverable nodes
322335
323-
replace <node1> <node2> Have <node1> transfer all data to <node2>,
324-
and then leave the cluster and shutdown
336+
replace <node1> <node2> Have <node1> transfer all data to <node2>,
337+
and then leave the cluster and shutdown
325338
326-
force-replace <node1> <node2> Reassign all partitions owned by <node1> to
327-
<node2> without first handing off data, and
328-
remove <node1> from the cluster.
339+
force-replace <node1> <node2> Reassign all partitions owned by <node1> to
340+
<node2> without first handing off data, and
341+
remove <node1> from the cluster.
329342
330343
Staging commands:
331-
plan Display the staged changes to the cluster
332-
commit Commit the staged changes
333-
clear Clear the staged changes
344+
plan Display the staged changes to the cluster
345+
commit Commit the staged changes
346+
clear Clear the staged changes
347+
348+
Status and information commands:
349+
status Display a concise summary of node membership
350+
availability and ring ownership.
351+
352+
members [--all] Print each valid cluster member nodename.
353+
If '--all' print all members regardless of
354+
current status.
355+
356+
partitions [--node=<node>] Print primary, secondary and stopped
357+
partition indices and ids for the current
358+
node, or for the specified node.
359+
360+
partition-count [--node=<node>] Print the cluster-wide number of
361+
partitions or the number of partitions
362+
on the specified node.
363+
364+
partition id=<id> Convert the given partition id to the
365+
matching index.
366+
367+
partition index=<index> Convert the given partition index to
368+
the matching id.
369+
334370
"
335371
esac
336372
}

0 commit comments

Comments
 (0)