- multi后不能执行get,没有结果返回的
- 也不能redirected,否则exec不行
132.120.2.134:26000> MULTI
OK
132.120.2.134:26000> get abc
QUEUED
132.120.2.134:26000> GET ABC
-> Redirected to slot [14740] located at 132.120.2.135:26001
(nil)
132.120.2.135:26001> SET ABC 2
OK
132.120.2.135:26001> GETSET
(error) ERR wrong number of arguments for 'getset' command
132.120.2.135:26001> EXEC
(error) ERR EXEC without MULTI
set如果redirected同样不行
132.120.2.135:26001> multi
OK
132.120.2.135:26001> set abc 1
-> Redirected to slot [7638] located at 132.120.2.134:26000
OK
multi可以小写,命令不区分大小写。 但是key区分。abc和ABC不同。
- 如果先set,再expire,可用set EX代替事务
132.120.2.134:26000> set abc 212 EX 30
OK