Fails over one node.
The basic syntax is:
couchbase-cli failover -c [host]:8091 -u [admin] -p [password] [options]
Graceful failover (the default) safely fails over nodes from clusters by allowing all in-flight operations to complete before implementing the failover operation. Graceful failover is the default behavior for the failover operation.
Hard failover immediately fails over nodes from clusters and is typically used when the node is in a bad state. Auto-failover is a hard failover.
The following are the command options:
|--server-failover=HOST:PORT||The server which will be failed over.|
|--force||Fail over a node from the cluster right away. Use the --force option to perform hard failover.|
The following examples show the failover, re-add, recovery and rebalance sequence operations. Nodes in a cluster are gracefully failed over, a node is re-added to a cluster, a delta recovery is implemented for the node, and rebalance is performed on the cluster:
couchbase-cli failover -c 192.168.0.1:8091 -u Administrator -p password \ --server-failover=192.168.0.2
couchbase-cli server-readd -c 192.168.0.1:8091 -u Administrator -p password \ --server-add=192.168.0.2
couchbase-cli recovery -c 192.168.0.1:8091 -u Administrator -p password \ --server-recovery=192.168.0.2 --recovery-type=delta
couchbase-cli rebalance -c 192.168.0.1:8091 -u Administrator -p password \
The following example shows a node failing over immediately: a hard failover is implemented rather than a graceful failover.
couchbase-cli failover -c 192.168.0.1:8091 -u Administrator -p password \ --server-failover=192.168.0.2 --force