tencent cloud

Tencent Cloud Distributed Cache (Redis OSS-Compatible)

cluster Family

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-08-11 11:12:00
Traduzido por IA

Command Introduction

The Cluster family of commands is used for shard topology queries in cluster mode. In the cluster architecture of a distributed cache database, data is distributed across multiple shards based on 16384 Hash slots. The Cluster commands help clients achieve intelligent routing and cluster state awareness. Their core commands can be categorized into the following two types based on feature:
Cluster Topology and Status Query
CLUSTER NODES: returns the ID, address, role (master/slave), status, and slot allocation information for all nodes in the cluster.
CLUSTER INFO: returns a summary of the overall cluster status, including key metrics such as cluster status (ok/fail), the number of allocated slots, and the number of known nodes.
CLUSTER SLOTS: returns the mapping between slot ranges and nodes. It is a core command for building client routing tables.
CLUSTER SHARDS (Redis 7.0+ / Valkey 8.0+): returns topology information at the shard granularity, making it easier to identify master-slave relationships and shard boundaries.
Slot Calculation and Routing
CLUSTER KEYSLOT: returns the hash slot number (0 - 16383) to which a specified Key belongs. Clients use this number to route requests to the correct shard node.
CLUSTER COUNTKEYSINSLOT: returns the number of keys in a specified slot (local node only). CLUSTER GETKEYSINSLOT: returns a list of key names in a specified slot.
For more information, see the Valkey official documentation: Cluster Command Group.

Command Support Overview

Slot Query Commands: cluster keyslot, cluster countkeysinslot, cluster getkeysinslot, cluster slots, cluster shards. Among these, cluster shards is supported only by the standard and cluster architectures of Redis version 7.0 and Valkey versions 8.0 and 9.0. The other four commands are supported by the cluster architecture in Redis version 4.0 and all subsequent versions, but are not supported by the standard architecture. cluster slots returns the slot-to-node mapping, and cluster shards returns the slot-to-shard mapping (an improved version for 7.0+).
Cluster Information Query Commands: cluster nodes, cluster info. These commands are supported by the cluster architecture in Redis version 4.0 and all subsequent versions, but are not supported by the standard architecture.
Cross-Slot Restriction: Cluster family commands operate on cluster metadata (slots, node information) and do not operate on user data keys. Therefore, no cross-slot access scenario exists.

Command Compatibility Matrix

The support status of this command family across different versions and architectures is shown in the table below (✓ indicates supported, ✗ indicates not supported, and — indicates that the command does not involve a cross-slot access scenario).
Note:
In the standard architecture, all cluster commands are not applicable (✗). In the cluster architecture, only slot query (cluster keyslot, cluster countkeysinslot, cluster getkeysinslot, cluster slots, cluster shards) and cluster information query (cluster nodes, cluster info) subcommands are supported. All other Ops management commands involving topology changes are globally unavailable. cluster shards is an improved version of cluster slots (introduced in Redis 7.0+), providing slot mapping information aggregated by shard.
Command
Valkey 9.0 Standard Architecture
Valkey 9.0 Cluster Architecture
Redis 7.0 / Valkey 8.0 Standard Architecture
Redis 7.0 / Valkey 8.0 Cluster Architecture
Redis 6.2 Standard Architecture
Redis 6.2 Cluster Architecture
Redis 5.0 Standard Architecture
Redis 5.0 Cluster Architecture
Redis 4.0 Standard Architecture
Redis 4.0 Cluster Architecture
Redis 2.8 Standard Architecture
Cluster Architecture Support for Cross-Slot
cluster keyslot
cluster countkeysinslot
cluster getkeysinslot
cluster slots
cluster shards
cluster nodes
cluster info

Ajuda e Suporte

Esta página foi útil?

comentários