FAQ - Is it possible to identify which node a particular key is on?

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

FAQ - Is it possible to identify which node a particular key is on?

Detail

At times it may be operationally necessary to identify which node a specific key resides upon. Is there a means of doing this?

Answer

Yes, this can be done within AQL using the explain command. An example of usage is shown below:

aql> explain select * from test.uqr where PK=1
[
{
"SET": "uqr",
"DIGEST": "42 7A 64 AE 7B 80 EE 02 3D B8 E9 00 8A F3 FF B0 7F DA EB 58",
"NAMESPACE": "test",
"PARTITION": 2626,
"STATUS": 2,
"UDF": "FALSE",
"KEY_TYPE": "STRING",
"TIMEOUT": 1000,
"NODE": "1771FE6C15290C00",
"POLICY": "AS_POLICY_REPLICA_MASTER",
"KEY_POLICY": "AS_POLICY_KEY_SEND"
}
]

In the above example the NODE is the NODE ID where the key resides at present. If the size of the cluster changes, the node on which the key resides will change as partitions migrate.

Notes

  • Only the location of the master record will be shown. Replica copies will not be listed.

Keywords

NODE MASTER RECORD LOCATION KEY

Timestamp

01/21/2019

2 Likes