Rack-zone awareness

Rack-zone awareness

Rack-Zone Awareness enables logical groupings of servers on a cluster where each server group physically belongs to a rack or Availability Zone. Enterprise Edition only.

Description

The Rack-Zone Awareness feature provides the ability to specify that active and corresponding replica partitions be created on servers that are part of a separate rack or zone. To enable Rack-Zone Awareness, all servers in a cluster must be upgraded.

Note: The Rack-Zone Awareness feature with its server group capability is an Enterprise Edition feature.

To configure servers into groups, use the couchbase-cli tool with the group-manage command.

CLI command and parameters

Table 1. group-manage options
Option Description
-c HOST:PORT or --cluster=HOST:PORT Cluster location
-u USERNAME or --username=USERNAME Administrator username for the cluster
-p PASSWORD or --password=PASSWORD Administrator password for the cluster
--list Shows the server groups and the servers assigned to each server group.
--create --group-name=groupName Creates a server group.
--delete --group-name=groupName Removes an empty server group.
--rename=newGroupName --group-name=oldGroupName Renames an existing server group.
--group-name=groupName --add-servers="HOST:PORT;HOST:PORT" Adds servers to a group.
--from-group=groupName --to-group=groupName --move-servers="HOST:PORT;HOST:PORT" Moves one or more servers from one group to another.

Syntax

General syntax with group-manage :


couchbase-cli group-manage -c [localhost]:[port] 
    -u [admin] -p [password]
    [options]

Example: Creating server groups

In the following example, a server group is created.

Note: The -create --group-name command can fail when an exclamation (!) is present inside the group name.

couchbase-cli group-manage -c 192.168.0.1:8091 
   -u myAdminName
   -p myAdminPassword
   --create --group-name=myGroupName

Example: Adding servers to server groups

In the following example, two servers are added to a server group using the group-manage command.


couchbase-cli group-manage -c 192.168.0.1:8091 
   -u myAdminName
   -p myAdminPassword
   --group-name=myNewGroup
   --add-servers="10.1.1.1:8091;10.1.1.2:8091"

In the following example, a server is added to the server group using the server-add command.

Note: The couchbase-cli group-manage command is the preferred method of adding servers to server group.

If the --group-name option is not specified with the server-add command, the server is added to the default group.


couchbase-cli server-add -c 192.168.0.1:8091
   --server-add=192.168.0.2:8091
   --server-add-username=Administrator
   --server-add-password=password
   --group-name=groupName

Example: Moving servers from server groups

In the following example, two servers are moved from one server group to another using the group-manage command.


couchbase-cli group-manage -c 192.168.0.1:8091 
   -u myAdminName
   -p myAdminPassword
   --from-group=myFirstGroup
   --to-group=mySecondGroup
   --move-servers="10.1.1.1:8091;10.1.1.2:8091"