List Cluster Nodes
The nodes currently included in a cluster can be listed, and details on each retrieved.
Couchbase Server allows the nodes currently included in a cluster to be listed, and data retrieved on each.
The examples assume:
A two-node cluster already exists; as at the conclusion of Join a Cluster and Rebalance.
The cluster has the Full Administrator username of
Administrator, and password of
All nodes in the current cluster can be viewed on the Servers screen of Couchbase Web Console. Note that this display is identical for all nodes in the cluster: therefore, whether you open the console on node one or node two of a two-node cluster, the same information is provided.
Proceed as follows:
Access the Couchbase Web Console Servers screen, on either node
184.108.40.206, by left-clicking on the Servers tab in the left-hand navigation bar. The display is as follows:
This indicates that the cluster currently consists of the nodes
220.127.116.11. Each row provides the following details:
name: The name of the node. In this case, each node is named after its IP address.
group: The Group occupied by the node. For information, see Server Group Awareness.
services: The services running on the node. For information, see Services.
CPU: The percentage of available CPU resources currently occupied.
RAM: The percentage of available RAM currently occupied. For information on Couchbase memory-management, see Memory.
swap: The percentage of available swap space in use.
disk used: The amount of disk space currently used, in megabytes.
items: The number of active and replica items currently on the node, in thousands. If the figure is
15.2 K/15.8 K, this indicates that 15.2 K items are in active vBuckets on the node, and 15.8 in replica. For information on vBuckets, see vBuckets.
To see further details of each node, left-click on the row for the node. The row expands vertically, as follows:
The additional information now shown includes:
Name, Version, Uptime, OS version, and Data Service RAM Quota.
Storage Paths for the Data, Index, and Analytics services, specified during node-initialization.
Currently available memory and disk-space.
Left-click on the
Statisticstab, and the right-hand side of the row. The Statistics screen is displayed:
The screen provides statistics related each of the buckets on the cluster. These include general information on operations; gets, sets, and deletes, read and write failures, and incoming and outgoing XDCR operations. Specific details are provided for server resources, vBucket resources, disk and DCP queues, Indexes, and more. Buckets can be selected from the pull-down menu at the top.
To list the nodes of a cluster with the CLI, use the
command, as follows:
couchbase-cli server-list -c 10.142.181.101:8091 \ --username Administrator \ --password password
The output is as follows:
firstname.lastname@example.org 10.142.181.101:8091 healthy active email@example.com 10.142.181.102:8091 healthy active
On occasions when a node is inactive or failed, output of the following kind is produced:
firstname.lastname@example.org 10.142.181.101:8091 healthy active email@example.com 10.142.181.102:8091 healthy inactiveFailed
Alternatively, the CLI
host-list command can be used:
couchbase-cli host-list -c 10.142.181.102:8091 --username Administrator --password password
Note that the command above specifies the second node in the cluster: any node-name in the cluster can be used, with the same results. The output is as follows:
Thus, the command returns a list of IP addresses and Couchbase Web Console port numbers.
To list all nodes in a cluster by means of the REST API, use the
/pools/default URI. A Couchbase pool represents computing resources
(such as machines, memory, CPU, and disks) that are used to
host Couchbase buckets. Couchbase Server clusters support
a single pool named
The method returns a large amount of information, which includes many of
the details used in the Couchbase Web Console
Statics panel, described
above. The output may be unformatted, and thereby difficult to read until
formatting is applied.
The following call passes the result to the
jq command-line JSON processor for
formatting, and then uses the standard command-line utility
reduce the output to available hostnames:
curl -u Administrator:password -v -X GET \ http://10.142.181.101:8091/pools/default | jq '.' | grep hostname
The output is as follows:
"hostname": "10.142.181.101:8091", "hostname": "10.142.181.102:8091",
For more information, see Retrieving Cluster Information.
Now that you have built a cluster and examined the nodes it contains, learn details on how to Remove a Node and Rebalance.