failover

failover

Failover a node in the cluster

SYNTAX

couchbase-cli failover [--cluster <url>] [--username <user>]
          [--password <password>][--server-failover <server_list>] [--force]
          [--no-progress-bar] [--no-wait]

DESCRIPTION

This command fails over one or more nodes. Nodes can be either hard failed over or gracefully failed over. A hard failover means that the failover happens immediately, but risks potential data loss. Graceful failover ensures that replication is up to date before the node is failed over so that there is no data loss, but the failover is not immediate. Note that if a node is already down you must perform a hard failover.

OPTIONS

-c
--cluster

Specfies the hostname of a node in the cluster. See the HOST FORMATS section for more information on specifying a hostname.

-u
--user <username>

Specifies the username of the user executing the command. If you do not have a user account with permision to execute the command then it will fail with an unauthorized error.

-p
--password <password>

Specifies the password of the user executing the command. If you do not have a user account with permision to execute the command then it will fail with an unauthorized error. If this argument is specified, but no password is given then the command will prompt the user for a password through non-echoed stdin. You may also specify your password by using the environment variable CB_REST_PASSWORD.

--server-failover <server_list>

A comma separated list of nodes to failover.

--force

Specifying this flag signifies that the nodes to be failed over should be hard failed over. A hard failover means that the failover is immediate, but you risk potential data loss. If this flag is not specified then the failover will occur only once replication is up to date. This means there will be no data loss, but the failover is not immediate. Note that if a server is already down you must hard fail it over.

--no-progress-bar

Disables showing the progress bar which tracks the progress of the rebalance. Note that a rebalance only occurs for graceful failovers (e.g. non-forced failovers). The failover command will still wait for rebalance completion even if this flag is specified, but the progress bar will not be shown.

--no-wait

Specifies that this command should not wait for the completion of rebalance before exiting. Note that a rebalance only occurs for graceful failovers (eg. non-forced failovers).

HOST FORMATS

When specifying a host for the couchbase-cli command the following formats are expected:

  • couchbase://<addr>

  • <addr>:<port>

  • http://<addr>:<port>

It is recommended to use the couchbase://<addr> format for standard installations. The other two formats allow an option to take a port number which is needed for non-default installations where the admin port has been set up on a port other that 8091.

EXAMPLES

To hard fail over a node run the following command:

$ couchbase-cli failover -c 192.168.1.5:8091 --username Administrator \
 --password password --server-failover 192.168.1.6:8091 --force

To gracefully failover a node run the following command:

$ couchbase-cli failover -c 192.168.1.5:8091 --username Administrator \
 --password password --server-failover 192.168.1.6:8091

ENVIRONMENT AND CONFIGURATION VARIABLES

CB_REST_PASSWORD Specifies the password of the user executing the command. This environment variable allows you to specify a default argument for the -p/--password argument on the command line. It also allows the user to ensure that their password are not cached in their command line history.

CB_REST_PASSWORD Specifies the password of the user executing the command. This environment variable allows you to specify a default argument for the -p/--password argument on the command line.