You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ docker exec -ti redis_cluster_redis-node-0_1 bash -c 'REDISCLI_AUTH=bitnami redis-cli -c'
127.0.0.1:6379> set a 1
-> Redirected to slot [15495] located at 172.18.0.6:6379
OK
172.18.0.6:6379> set b 2
-> Redirected to slot [3300] located at 172.18.0.7:6379
OK
172.18.0.7:6379> set c 3
-> Redirected to slot [7365] located at 172.18.0.3:6379
OK
172.18.0.3:6379> set d 4
-> Redirected to slot [11298] located at 172.18.0.6:6379
OK
172.18.0.6:6379> set e 5
OK
172.18.0.6:6379> set f 6
-> Redirected to slot [3168] located at 172.18.0.7:6379
OK
172.18.0.7:6379> set g 7
-> Redirected to slot [7233] located at 172.18.0.3:6379
OK
172.18.0.3:6379> set h 8
-> Redirected to slot [11694] located at 172.18.0.6:6379
OK
172.18.0.6:6379> set i 9
OK
MSET will fail if keys are belongs to multiple master nodes
$ docker exec -ti redis_cluster_redis-node-0_1 bash -c 'REDISCLI_AUTH=bitnami redis-cli -c mset a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9'
(error) CROSSSLOT Keys in request don't hash to the same slot
MULTI, SET, SET, SET, EXEC will fail if keys are belongs to multiple master nodes
$ docker exec -ti redis_cluster_redis-node-3_1 bash -c 'REDISCLI_AUTH=bitnami redis-cli -c'
172.18.0.6:6379> multi
OK
172.18.0.6:6379> set a 1
QUEUED
172.18.0.6:6379> set b 2
-> Redirected to slot [3300] located at 172.18.0.7:6379
OK
172.18.0.7:6379> set c 3
-> Redirected to slot [7365] located at 172.18.0.3:6379
OK
172.18.0.3:6379> exec
(error) ERR EXEC without MULTI
Master Nodes are 3, 4, 5. Slave Nodes are 0, 1, 2.