Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Managed Service for Redis
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Information about existing clusters
    • Creating clusters
    • Changing cluster and database settings
    • Connecting to databases
    • Stop and start the cluster
    • Managing hosts in a cluster
    • How to manage shards
    • Managing backups
    • Changing the master
    • Deleting clusters
  • Concepts
    • Overview
    • Host classes
    • Network in Managed Service for Redis
    • Sharding
    • Backups
    • Replication and fault tolerance
    • Supported clients
    • Limitations of Managed Service for Redis
    • Service quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Before February 1, 2020
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • BackupService
      • ClusterService
      • ResourcePresetService
      • OperationService
    • REST
      • Overview
      • Backup
        • Overview
        • get
        • list
      • Cluster
        • Overview
        • addHosts
        • addShard
        • backup
        • create
        • delete
        • deleteHosts
        • deleteShard
        • get
        • getShard
        • list
        • listBackups
        • listHosts
        • listLogs
        • listOperations
        • listShards
        • move
        • rebalance
        • rescheduleMaintenance
        • restore
        • start
        • startFailover
        • stop
        • streamLogs
        • update
      • ResourcePreset
        • Overview
        • get
        • list
      • Operation
        • Overview
        • get
  • Questions and answers
    • General questions
  1. Step-by-step instructions
  2. How to manage shards

Managing cluster shards

  • List shards in a cluster
  • Getting detailed information about a shard
  • Add a shard
  • Delete a shard

You can add and remove cluster shards, request a list of shards in your cluster, and rebalance your cluster.

Warning

You can only manage shards in sharded clusters. Existing non-sharded clusters can't be sharded later. To create a sharded cluster, see Creating clusters.

List shards in a cluster

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

  2. Click the name of a cluster and open the Shards tab.

If you don't have the Yandex.Cloud command line interface yet, install and initialize 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 shards list --cluster-name <cluster name>
+--------------+
|     NAME     |
+--------------+
| test-shard-1 |
| test-shard-2 |
| test-shard-3 |
| test-shard-4 |
| test-shard-5 |
+--------------+

Getting detailed information about a shard

If you don't have the Yandex.Cloud command line interface yet, install and initialize 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 information about a shard, run the following command:

$ yc managed-redis shards get <shard name> --cluster-name <cluster name>

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

Add a shard

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

  2. Click on the name of the cluster and go to the Shards tab.

  3. Click Add shard.

  4. Specify the shard parameters:

    • Name of the shard.
    • Availability zones.
    • Add more hosts to the shard if needed.
  5. Click Create shard.

After adding a new shard, you must rebalance your cluster:

  1. Wait until the cluster status changes to Running.
  2. Open the Hosts tab and click Rebalance cluster. Click OK.

If you don't have the Yandex.Cloud command line interface yet, install and initialize 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 two-host shard to the cluster:

$ yc managed-redis shards add --name <name of the new shard> --cluster-name <cluster name> \
  --host zone-id=<availability zone>,subnet-name=<subnet name> \
  --host zone-id=<availability zone>,subnet-name=<subnet name>

After adding a new shard, you must rebalance your cluster:

$ yc managed-redis cluster --cluster-name test-sharding-2 rebalance 

Delete a shard

Alert

All the shard hosts are deleted with the shard.

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

  2. Click on the name of a cluster and open the Shards tab.

  3. Click in the row of the shard, then click Delete in the menu that opens.

  4. In the window that opens, click Delete.

If you don't have the Yandex.Cloud command line interface yet, install and initialize 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 delete a shard from the cluster, run:

$ yc managed-redis shards delete <shard name>
     --cluster-name=<cluster name>

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

In this article:
  • List shards in a cluster
  • Getting detailed information about a shard
  • Add a shard
  • Delete a shard
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC