Managing hosts in a cluster

You can add and remove cluster hosts and request a list of hosts in the selected cluster.

Getting a list of cluster hosts

  1. Go to the folder page and select Managed Service for Redis.

  2. Click on the name of the cluster you need and select the Hosts tab.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of databases in a cluster, run the command:

$ yc managed-redis host list
     --name=<cluster name>

+---------------------------------+----------------------+--------+---------------+
|               NAME              |      CLUSTER ID      | HEALTH |    ZONE ID    |
+---------------------------------+----------------------+--------+---------------+
| rc1a-...caf.mdb.yandexcloud.net | c9qb2qj7nnt3b26fr0gg | ALIVE  | ru-central1-a |
| rc1c-...bgc.mdb.yandexcloud.net | c9qb2qj7nnt3b26fr0gg | ALIVE  | ru-central1-c |
+---------------------------------+----------------------+--------+---------------+

You can query the cluster name with the list of clusters in the folder.

To get a list of cluster hosts, use the listHosts method.

Adding a host

The number of hosts in Managed Service for Redis clusters is limited by the CPU and RAM quotas available to DB clusters in your cloud. To check the resources in use, open the Quotas page and find the Yandex Managed Service for Redis block.

  1. Go to the folder page and select Managed Service for Redis.

  2. Click on the name of the cluster you need and go to the Hosts tab.

  3. Click Add host.

  4. Specify the host parameters:

    • Availability zone.

    • Subnet (if the necessary subnet is not in the list, create it.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To add a host to the cluster:

  1. Request a list of cluster subnets to select one for the new host:

    $ yc vpc subnet list
    
    +-----------+-----------+------------+---------------+------------------+
    |     ID    |   NAME    | NETWORK ID |     ZONE      |      RANGE       |
    +-----------+-----------+------------+---------------+------------------+
    | b0cl69... | default-c | enp6rq7... | ru-central1-c | [172.16.0.0/20]  |
    | e2lkj9... | default-b | enp6rq7... | ru-central1-b | [10.10.0.0/16]   |
    | e9b0ph... | a-2       | enp6rq7... | ru-central1-a | [172.16.32.0/20] |
    | e9b9v2... | default-a | enp6rq7... | ru-central1-a | [172.16.16.0/20] |
    +-----------+-----------+------------+---------------+------------------+
    

    If the necessary subnet is not in the list, create it.

  2. See the description of the CLI command for adding a host:

    $ yc managed-redis host add --help
    
  3. Run the add host command:

    $ yc managed-redis host add
         --name <cluster name>
         --host zone-id=<availability zone>,subnet-id=<subnet ID>
    

    Managed Service for Redis will run the add host operation.

    The subnet ID should be specified if the availability zone contains multiple subnets, otherwise Managed Service for Redis automatically selects a single subnet. You can retrieve the cluster name with the list of clusters in the folder.

To add a host to the cluster, use the addHosts method.

Removing a host

You can remove a host from a Redis cluster if it is not the only host in it. To replace a single host, first create a new host and then remove the old one.

If the host is the master when deleted, Managed Service for Redis automatically assigns another replica as the master.

  1. Go to the folder page and select Managed Service for Redis.

  2. Click on the name of the cluster you want and select the Hosts tab.

  3. Click image in the row of the host you need.

  4. In the window that opens, check Delete host and click Confirm.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To remove a host from the cluster, run:

$ yc managed-redis host delete <hostname>
     --name=<cluster name>

The host name can be requested with a list of cluster hosts, and the cluster name can be requested with a list of clusters in the folder.

To remove a host, use the deleteHosts method.