A newer version of this documentation is available.

View Latest
March 9, 2025
+ 12

Manage server groups

SYNOPSIS

couchbase-cli group-manage [--cluster <url>] [--username <user>]
    [--password <password>] [--create] [--delete] [--list] [--rename <group>]
    [--move-servers] [--group-name <name>] [--from-group <name>]
    [--to-group <name>]

DESCRIPTION

This command is used to manage server groups in a Couchbase cluster. When moving servers between groups it is possible that you may need to rebalance the cluster since the cluster topology may be changing. You should always run rebalance after running this command.

OPTIONS

-c
--cluster

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

-u
--username <username>

Specifies the username of the user executing the command. If you do not have a user account with permission 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 permission 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.

--create

Creates a new server group.

--delete

Deletes a server group.

--list

Lists all server groups.

--rename <group>

Renames a server group. It takes the new name of the group as a parameter.

--move-servers <server_list>

A list of servers to move between groups.

--group-name <name>

The name of the server group.

--from-group <name>

The group to move servers from.

--to-group <name>

The group to move servers to. This group must already exists.

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 create a new server group called "rack1" run the following command.

$ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \
 -p password --create --group-name rack1

To rename the server group "rack1" to "rack2" run the following command.

$ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \
 -p password --group-name rack1 --rename rack2

To list all of the server groups in a cluster run the following command.

$ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \
 -p password --list

To delete the server group "rack2" run the following command.

$ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \
 -p password --delete --group-name rack2

To move the servers 192.168.1.5 and 192.168.1.6 from server group "rack3" to server group "rack4" run the following command.

$ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \
 -p password --move-servers 192.168.1.5,192.168.1.6 --from-group rack3 \
 --to-group rack4

ENVIRONMENT AND CONFIGURATION VARIABLES

CB_REST_USERNAME

Specifies the username to use when executing the command. This environment variable allows you to specify a default argument for the -u/--username argument on the command line.

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.

SEE ALSO

COUCHBASE-CLI

Part of the couchbase-cli suite