Removing a Node

Removing a Node

You can remove any node from the Couchbase cluster.

Full Administrators and Cluster Administrators can remove a node from the Couchbase cluster.

If you remove a node that is running one of the services, it will have following results:
  • Data service - reduced capacity to handle key/value workload.
  • Index service - index data loss on that node. This service does not support rebalance. When a node running the index service is removed or failed over, indexes that reside on the node are not moved to another node after rebalancing. These indexes are no longer available for queries and are dropped.
  • Query service - loss of query capability in that node.

Before you remove a node from the cluster, ensure that you have the capacity within the remaining nodes to handle the workload. Removing a node does not stop the node from servicing requests. Instead, it only marks the node as ready for removal from the cluster. You must perform a rebalance operation to complete the removal process. Once a node is removed, it is no longer part of the cluster and can be switched off, updated, or upgraded.

Prevent possible problems during online upgrades. Occasionally, during an online upgrade if all old nodes are removed from the cluster, clients may no longer know about any nodes and fail to connect. To prevent such problems, make sure that you provide one of the following solutions:
  • At least one of the original nodes is maintained in the cluster, and this node is listed in the client's server configuration.
  • The client's server configuration is appropriately updated to include at least one new node before the last old node is removed.

Using the UI

To remove a node from an existing cluster using the Web Console:
  1. From the Couchbase Web Console > Servers page, click the name / group to view the details. Select a node that you want to remove and click Remove.
  2. After the node is removed, click Rebalance to rebalance the cluster.

    For more information on how to rebalance the node, see Rebalancing a Cluster.

Using the CLI

You cannot mark a node for removal from the command-line without simultaneously initiating a rebalance operation.

The rebalance command accepts one or more --server-add or --server-remove options. This adds or removes the server from the cluster, and immediately initiates a rebalance operation.

To remove a node during a rebalance operation:

> couchbase-cli rebalance --cluster=127.0.0.1:8091 \
          --user Administrator --password Password \
          --server-remove=192.168.0.73

Using the REST API

Remove a node from a cluster with a curl command.

Curl request example:
curl -u admin:password -d otpNode=ns_1@192.168.0.107 \
          http://192.168.0.106:8091/controller/ejectNode 

See also Removing Nodes from Clusters in the REST API reference.