basho/riak — pull request #148 by jtuple (2012-05-25 07:11:56+00:00)
Title: Add staged clustering support to riak-admin

Update `riak-admin` to use the staged clustering support added in response to basho/riak_core#177. The staged cluster interface is provided by `riak-admin cluster` which provides commands to stage a set of changes as well as the plan, commit, and clear commands to view the set of pending changes and commit/clear them.

See the related `basho/riak_core` pull-request: basho/riak_core#181

As part of this change, the non-staged cluster commands are changed to no longer work without adding `-f` such as `riak-admin join -f riak@127.0.0.1`. Otherwise, the commands print-out a message about the new staged clustering system. This change is open to discussion, but I wanted to be opinionated and lightly push users to the new approach as it is much safer and provides much more insight than the non-staged commands.

Typing `riak-admin cluster` details the new clustering commands:

```
Usage: riak-admin cluster

The following commands stage changes to cluster membership. These commands
do not take effect immediately. After staging a set of changes, the staged
plan must be committed to take effect:

join Join node to the cluster containing
leave Have this node leave the cluster and shutdown
leave Have leave the cluster and shutdown

force-remove Remove from the cluster without
first handing off data. Designed for
crashed, unrecoverable nodes

replace Have transfer all data to ,
and then leave the cluster and shutdown

force-replace Reassign all partitions owned by to
without first handing off data, and
remove from the cluster.

Staging commands:
plan Display the staged changes to the cluster
commit Commit the staged changes
clear Clear the staged changes
```