Extract only node-id of a particular node in Redis Cluster when using CLUSTER NODES command Extract only node-id of a particular node in Redis Cluster when using CLUSTER NODES command shell shell

Extract only node-id of a particular node in Redis Cluster when using CLUSTER NODES command


Just run this command, with corresponding ip and port:

./redis-cli -h 172.31.160.110 -p 7000 CLUSTER NODES | grep myself | cut -d" " -f1

Output:

a415b9df6ce0c3c757ad4270242ae432147cacbb

See this tutorials: http://codeflex.co/configuring-redis-cluster-on-linux/


Just log into the specified node you want to get it's ID by this command

redis-cli -h ip -p port

then type

CLUSTER MYID