-
Notifications
You must be signed in to change notification settings - Fork 24.5k
Closed
Description
$src/redis-cli --cluster call 127.0.0.1:8101 set Key1 Value1
>>> Calling set Key1 Value1
127.0.0.1:8101: OK
127.0.0.1:8103: MOVED 5291 127.0.0.1:8101
127.0.0.1:8102: MOVED 5291 127.0.0.1:8101
It succeeds in one shard but attempts writing to multiple shards.
Is it worth to introduce some command-line flags to control the numbers of shards a command can go to?
-
specificflag only sends a command to a specific shard and prints the response like below
$src/redis-cli --cluster --spcific call 127.0.0.1:8101 set Key1 Value1
>>> Calling set Key1 Value1 specifically on 127.0.0.1:8101
OK
-
mastersflag will broadcast a command only to all masters. A large cluster may have too many slaves and we don't want the response from them
$src/redis-cli --cluster --master call 127.0.0.1:8101 set Key1 Value1
>>> Calling set Key1 Value1 to all Masters
.
-
slavesflag will broadcast a command only to all slaves. For example, the read commands or replication info may go to slaves only.
$src/redis-cli --cluster --slaves call 127.0.0.1:8101 set Key1 Value1
>>> Calling set Key1 Value1 to all slaves
.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels