Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for Valkey™
  • Getting started
    • All guides
      • Information about existing clusters
      • Creating a cluster
      • Updating cluster settings
      • Valkey™ version upgrade
      • Stopping and starting a cluster
      • Managing cluster hosts
      • Migrating hosts to a different availability zone
      • Managing backups
      • Deleting a cluster
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Getting a list of cluster hosts
  • Creating a host
  • Changing a host
  • Removing a host
  1. Step-by-step guides
  2. Clusters
  3. Managing cluster hosts

Managing Valkey™ cluster hosts

Written by
Yandex Cloud
Updated at May 13, 2025
  • Getting a list of cluster hosts
  • Creating a host
  • Changing a host
  • Removing a host

You can add and remove cluster hosts and manage their settings. For information about moving cluster hosts to a different availability zone, see this guide.

Getting a list of cluster hosts

Management console
CLI
REST API
gRPC API
  1. Go to the folder page and select Yandex Managed Service for Valkey™.
  2. Click the name of the cluster you need and select the Hosts tab.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of cluster hosts, run the command:

yc managed-redis host list \
  --cluster-name=<cluster_name>

Result:

+---------------------------------+----------------------+------------+---------+--------+-------------------+
|              NAME               |      CLUSTER ID      | SHARD NAME |  ROLE   | HEALTH |      ZONE ID      |
+---------------------------------+----------------------+------------+---------+--------+-------------------+
| rc1a-...caf.mdb.yandexcloud.net | c9qb2q230gg1******** | shard1     | MASTER  | ALIVE  | ru-central1-a     |
| rc1b-...bgc.mdb.yandexcloud.net | c9qb2q230gg1******** | shard1     | REPLICA | ALIVE  | ru-central1-b     |
+---------------------------------+----------------------+------------+---------+--------+-------------------+

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

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.ListHosts method and send the following request, e.g., via cURL:

    curl \
        --request GET \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/hosts'
    

    You can request the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.ListHosts call and send the following request, e.g., via gRPCurl:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>"
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.ClusterService.ListHosts
    

    You can request the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Creating a host

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

Note

Public access to hosts can only be configured for clusters created with enabled TLS support.

Management console
CLI
Terraform
REST API
gRPC API

To create a host:

  1. Go to the folder page and select Yandex Managed Service for Valkey™.
  2. Click the cluster name and go to the Hosts tab.
  3. Click Create host.
  4. Specify the host parameters:
    • Availability zone.

    • Subnet (if the required subnet is not on the list, create it).

    • Host priority for assignment as a master.

    • If necessary, configure public access to the host.

    • If you are adding a host to a sharded cluster, select a shard.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To create a host:

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

    yc vpc subnet list
    

    Result:

    +----------------------+-----------+-----------------------+---------------+------------------+
    |          ID          |   NAME    |       NETWORK ID      |     ZONE      |      RANGE       |
    +----------------------+-----------+-----------------------+---------------+------------------+
    | b0cl69a2b4c6******** | default-d | enp6rq72rndgr******** | ru-central1-d | [172.16.0.0/20]  |
    | e2lkj9qwe762******** | default-b | enp6rq72rndgr******** | ru-central1-b | [10.10.0.0/16]   |
    | e9b0ph42bn96******** | a-2       | enp6rq72rndgr******** | ru-central1-a | [172.16.32.0/20] |
    | e9b9v22r88io******** | default-a | enp6rq72rndgr******** | ru-central1-a | [172.16.16.0/20] |
    +----------------------+-----------+-----------------------+---------------+------------------+
    

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

  2. View a 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 \
      --cluster-name=<cluster_name> \
      --host zone-id=<availability_zone>,`
        `subnet-id=<subnet_ID>,`
        `assign-public-ip=<public_access>,`
        `replica-priority=<host_priority>,`
        `shard-name=<shard_name>
    

    Where:

    • --cluster-name: Yandex Managed Service for Valkey™ cluster name. You can get it with the list of clusters in a folder.
    • --host: Host parameters:
      • zone-id: Availability zone.
      • subnet-id: Subnet ID. Specify if two or more subnets are created in the selected availability zone.
      • assign-public-ip: Internet access to the host via a public IP address, true or false.
      • replica-priority: Host priority for assignment as a master if the primary master fails. It is only available for non-sharded clusters.
      • shard-name: Name of the shard to create the host in if the cluster is sharded.

To create a host:

  1. Open the current Terraform configuration file with an infrastructure plan.

    For more information about creating this file, see Creating clusters.

  2. Add a host block to the Yandex Managed Service for Valkey™ cluster description:

    resource "yandex_mdb_redis_cluster" "<cluster_name>" {
      ...
      host {
        zone             = "<availability_zone>"
        subnet_id        = "<subnet_ID>"
        assign_public_ip = <public_access>
        replica_priority = <host_priority>
        shard_name       = "<shard_name>"
      }
    }
    

    Where assign_public_ip is public access to the host, true or false.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

Time limits

A Terraform provider sets the timeout for Yandex Managed Service for Valkey™ cluster operations:

  • Creating a cluster, including by restoring one from a backup: 15 minutes.
  • Editing a cluster: 60 minutes.
  • Deleting a cluster: 15 minutes.

Operations exceeding the set timeout are interrupted.

How do I change these limits?

Add the timeouts block to the cluster description, for example:

resource "yandex_mdb_redis_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.AddHosts method and make a request, e.g., via cURL:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/hosts:batchCreate' \
        --data '{
                  "hostSpecs": [
                    {
                      "zoneId": "<availability_zone>",
                      "subnetId": "<subnet_ID>",
                      "shardName": "<shard_name>",
                      "replicaPriority": "<host_priority>",
                      "assignPublicIp": <public_access_to_cluster_host>
                    }
                  ]
                }'
    

    Where hostSpecs sets the host parameters:

    • zoneId: Availability zone.
    • subnetId: Subnet ID. Specify if two or more subnets are created in the selected availability zone.
    • shardName: Shard name for the host. Only used if cluster sharding is enabled.
    • replicaPriority: Priority for assigning the host as a master if the primary master fails.
    • assignPublicIp: Internet access to the host via a public IP address, true or false. You can enable public access only if TLS support is enabled in the cluster.

    You can get the cluster ID with a list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.AddHosts call and make a request, e.g., via gRPCurl:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>",
              "host_specs": [
                {
                  "zone_id": "<availability_zone>",
                  "subnet_id": "<subnet_ID>",
                  "shard_name": "<shard_name>",
                  "replica_priority": "<host_priority>",
                  "assign_public_ip": <public_access_to_cluster_host>
                }
              ] 
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.ClusterService.AddHosts
    

    Where host_specs represents the host parameters:

    • zone_id: Availability zone.
    • subnet_id: Subnet ID. Specify if two or more subnets are created in the selected availability zone.
    • shard_name: Shard name for the host. Only used if cluster sharding is enabled.
    • replica_priority: Priority for assigning the host as a master if the primary master fails.
    • assign_public_ip: Internet access to the host via a public IP address, true or false. You can enable public access only if TLS support is enabled in the cluster.

    You can get the cluster ID with a list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Warning

If you cannot connect to the host you added, check that the cluster security group is configured correctly for the host's subnet.

Changing a host

Note

Access to hosts from the Internet via public IP addresses is possible only if the cluster has been created with TLS support enabled.

Management console
CLI
Terraform
REST API
gRPC API

To change the parameters of the cluster host:

  1. Go to the folder page and select Yandex Managed Service for Valkey™.

  2. Click the cluster name and open the Hosts tab.

  3. Click in the host's row and select Edit.

  4. Set new settings for the host:

    1. Enable Public access if the host must be accessible from outside Yandex Cloud.
    2. Specify host priority for assignment as a master.
  5. Click Save.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To change the parameters of the host, run the command:

yc managed-redis host update <host_name> \
  --cluster-name=<cluster_name> \
  --assign-public-ip=<public_access> \
  --replica-priority=<host_priority>

Where --assign-public-ip is public access to the host, true or false.

You can request the host name with the list of cluster hosts, and the cluster name, with the list of clusters in the folder.

To change the parameters of the cluster host:

  1. Open the current Terraform configuration file with an infrastructure plan.

    For more information about creating this file, see Creating clusters.

  2. In the Yandex Managed Service for Valkey™ cluster description, change the attributes of the host block corresponding to the host you are updating.

    resource "yandex_mdb_redis_cluster" "<cluster_name>" {
      ...
      host {
        zone             = "<availability_zone>"
        subnet_id        = "<subnet_ID>"
        assign_public_ip = <public_access>
        replica_priority = <host_priority>
        shard_name       = "<shard_name>"
      }
    }
    

    Where assign_public_ip is public access to the host, true or false.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Confirm updating the resources.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.UpdateHosts method and send the following request, e.g., via cURL:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the updateMask parameter as a single comma-separated string.

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/hosts:batchUpdate' \
        --data '{
                  "updateHostSpecs": [
                    {
                      "hostName": "<host_name>",
                      "replicaPriority": "<host_priority>",
                      "assignPublicIp": <public_access_to_cluster_host>,
                      "updateMask": "replicaPriority,assignPublicIp"
                    }
                  ]
                }'
    

    Where updateHostSpecs represents the host parameters:

    • hostName: Name of the host you need to update. To find out the name, get a list of hosts in the cluster.
    • replicaPriority: Host priority for assignment as a master if the primary master fails.
    • assignPublicIp: Internet access to the host via a public IP address, true or false. You can enable public access only if TLS support is enabled in the cluster.
    • updateMask: List of parameters to update as a single string, separated by commas.

    You can request the cluster ID with the list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.UpdateHosts call and send the following request, e.g., via gRPCurl:

    Warning

    The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the update_mask parameter as an array of paths[] strings.

    Format for listing settings
    "update_mask": {
        "paths": [
            "<setting_1>",
            "<setting_2>",
            ...
            "<setting_N>"
        ]
    }
    
    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>",
              "update_host_specs": [
                {
                  "host_name": "<host_name>",
                  "replica_priority": "<host_priority>",
                  "assign_public_ip": <public_access_to_cluster_host>,
                  "update_mask": {
                    "paths": ["replica_priority", "assign_public_ip"]
                  }
                }
              ] 
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.ClusterService.UpdateHosts
    

    Where update_host_specs represents the host parameters:

    • host_name: Name of the host you need to update. To find out the name, get a list of hosts in the cluster.
    • replica_priority: Host priority for assignment as a master if the primary master fails.
    • assign_public_ip: Internet access to the host via a public IP address, true or false. You can enable public access only if TLS support is enabled in the cluster.
    • update_mask: List of parameters to update as an array of paths[] strings.

    You can request the cluster ID with the list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Warning

If you cannot connect to the host you added, check that the cluster security group is configured correctly for the host's subnet.

Removing a host

You can remove a host from a Valkey™ 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 at the time of deletion, Yandex Managed Service for Valkey™ will automatically assign another replica as the master.

You cannot remove a host if the number of hosts in a cluster or cluster shard is equal to the minimum value. For more information, see Quotas and limits.

Management console
CLI
Terraform
REST API
gRPC API

To remove a host from a cluster:

  1. Go to the folder page and select Yandex Managed Service for Valkey™.
  2. Click the cluster name and open the Hosts tab.
  3. In the cluster row, click and select Delete.
  4. In the window that opens, enable Delete host and click Confirm.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. 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 <host_name> \
  --cluster-name=<cluster_name>

You can request the host name with the list of cluster hosts, and the cluster name, with the list of clusters in the folder.

To remove a host from a cluster:

  1. Open the current Terraform configuration file with an infrastructure plan.

    For more information about creating this file, see Creating clusters.

  2. Delete the host block from the Yandex Managed Service for Valkey™ cluster description.

  3. Make sure the settings are correct.

    1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.

    2. Run this command:

      terraform validate
      

      Terraform will show any errors found in your configuration files.

  4. Type yes and press Enter.

    1. Run this command to view the planned changes:

      terraform plan
      

      If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.

    2. If everything looks correct, apply the changes:

      1. Run this command:

        terraform apply
        
      2. Confirm updating the resources.

      3. Wait for the operation to complete.

For more information, see the Terraform provider documentation.

Time limits

A Terraform provider sets the timeout for Yandex Managed Service for Valkey™ cluster operations:

  • Creating a cluster, including by restoring one from a backup: 15 minutes.
  • Editing a cluster: 60 minutes.
  • Deleting a cluster: 15 minutes.

Operations exceeding the set timeout are interrupted.

How do I change these limits?

Add the timeouts block to the cluster description, for example:

resource "yandex_mdb_redis_cluster" "<cluster_name>" {
  ...
  timeouts {
    create = "1h30m" # 1 hour 30 minutes
    update = "2h"    # 2 hours
    delete = "30m"   # 30 minutes
  }
}
  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Use the Cluster.DeleteHosts method and make a request, e.g., via cURL:

    curl \
        --request POST \
        --header "Authorization: Bearer $IAM_TOKEN" \
        --header "Content-Type: application/json" \
        --url 'https://mdb.api.cloud.yandex.net/managed-redis/v1/clusters/<cluster_ID>/hosts:batchDelete' \
        --data '{
                  "hostNames": [ "<host_name>" ]
                }'
    

    Where hostNames is the name of the host to delete. To find out the name, get a list of hosts in the cluster.

    You can get the cluster ID with a list of clusters in the folder.

  3. View the server response to make sure the request was successful.

  1. Get an IAM token for API authentication and put it into the environment variable:

    export IAM_TOKEN="<IAM_token>"
    
  2. Clone the cloudapi repository:

    cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
    

    Below, we assume the repository contents are stored in the ~/cloudapi/ directory.

  3. Use the ClusterService.DeleteHosts call and make a request, e.g., via gRPCurl:

    grpcurl \
        -format json \
        -import-path ~/cloudapi/ \
        -import-path ~/cloudapi/third_party/googleapis/ \
        -proto ~/cloudapi/yandex/cloud/mdb/redis/v1/cluster_service.proto \
        -rpc-header "Authorization: Bearer $IAM_TOKEN" \
        -d '{
              "cluster_id": "<cluster_ID>",
              "host_names": [ "<host_name>" ]
            }' \
        mdb.api.cloud.yandex.net:443 \
        yandex.cloud.mdb.redis.v1.ClusterService.DeleteHosts
    

    Where host_names is the name of the host to delete. To find out the name, get a list of hosts in the cluster.

    You can get the cluster ID with a list of clusters in the folder.

  4. View the server response to make sure the request was successful.

Was the article helpful?

Previous
Stopping and starting a cluster
Next
Migrating hosts to a different availability zone
© 2025 Direct Cursus Technology L.L.C.