All Products
Search
Document Center

Tair (Redis® OSS-Compatible):Query the data node and slot to which a key belongs

Last Updated:Mar 28, 2026

Tair and Tair cluster instances restrict commands that span multiple hash slots — a single command cannot operate on keys that belong to different slots. Before running such a command, use CLUSTER KEYSLOT to confirm which slot a key belongs to.

For cluster instances in proxy mode, INFO KEY returns both the slot number and the data node index in one call.

Prerequisites

Before you begin, ensure that you have:

Query the slot of a key

Run the following command to get the hash slot for a key:

CLUSTER KEYSLOT <key>

Example: Query the slot for the key foo:

CLUSTER KEYSLOT foo

Expected output:

12182

Query the data node and slot (proxy mode only)

For cluster instances in proxy mode, use the INFO KEY command to get both the slot and the data node index:

INFO KEY <key>

Example: Query the slot and data node for the key foo:

INFO KEY foo

Expected output:

slot:12182 node_index:2

INFO KEY is developed in-house by the Alibaba Cloud Tair team and is supported only for cluster instances in proxy mode.

What's next