failover

failover

Fails over one or more servers.

Syntax

The basic syntax is:

couchbase-cli failover -c [host]:8091 -u [admin] -p [password] [options]

Description

Nodes are failed over with one of the following methods:

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.

Options

The following are the command options:

Table 1. failover options
Option Description
--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.

Examples

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