127.0.0.1:6381> keys * (empty array) 127.0.0.1:6381> set k1 v1 (error) MOVED 12706 192.168.92.131:6385 127.0.0.1:6381> set k2 v2 OK 127.0.0.1:6381> keys * 1) "k2" 127.0.0.1:6381> flushall OK 127.0.0.1:6381> keys * (empty array) 127.0.0.1:6381> quit [root@localhost cluster]# redis-cli -a abc123 -p 6381 -c Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 127.0.0.1:6381> keys * (empty array) 127.0.0.1:6381> set k1 v1 -> Redirected to slot [12706] located at 192.168.92.131:6385 OK 192.168.92.131:6385> get k1 "v1" 192.168.92.131:6385> set k2 v2 -> Redirected to slot [449] located at 192.168.92.129:6381 OK 192.168.92.129:6381> set k3 v3 OK 192.168.92.129:6381> set k4 v4 -> Redirected to slot [8455] located at 192.168.92.130:6383 OK 192.168.92.130:6383> cluster keyslot k1 (integer) 12706 192.168.92.130:6383> cluster keyslot k2 (integer) 449
127.0.0.1:6381> keys *
(empty array)
127.0.0.1:6381> set k1 v1
(error) MOVED 12706 192.168.92.131:6385
127.0.0.1:6381> set k2 v2
OK
127.0.0.1:6381> keys *
1) "k2"
127.0.0.1:6381> flushall
OK
127.0.0.1:6381> keys *
(empty array)
127.0.0.1:6381> quit
[root@localhost cluster]# redis-cli -a abc123 -p 6381 -c
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6381> keys *
(empty array)
127.0.0.1:6381> set k1 v1
-> Redirected to slot [12706] located at 192.168.92.131:6385
OK
192.168.92.131:6385> get k1
"v1"
192.168.92.131:6385> set k2 v2
-> Redirected to slot [449] located at 192.168.92.129:6381
OK
192.168.92.129:6381> set k3 v3
OK
192.168.92.129:6381> set k4 v4
-> Redirected to slot [8455] located at 192.168.92.130:6383
OK
192.168.92.130:6383> cluster keyslot k1
(integer) 12706
192.168.92.130:6383> cluster keyslot k2
(integer) 449
127.0.0.1:6381> shutdown not connected> quit [root@localhost ~]# redis-server /myredis/cluster/redisCluster6385.conf [root@localhost ~]# redis-server /myredis/cluster/redisCluster6386.conf [root@localhost ~]# ps -ef|grep redis root 10600 1 0 20:06 ? 00:00:00 redis-server 0.0.0.0:6385 [cluster] root 10612 1 0 20:06 ? 00:00:00 redis-server 0.0.0.0:6386 [cluster] root 10633 10202 0 20:06 pts/0 00:00:00 grep --color=auto redis [root@localhost ~]# redis-cli -a abc123 -p 6385 Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe. 127.0.0.1:6385> get k1 (nil) 127.0.0.1:6385> set k1 v1 OK 127.0.0.1:6385> set k2 v2 (error) MOVED 449 192.168.92.129:6381 127.0.0.1:6385> flushall OK 127.0.0.1:6385> keys * (empty array) 127.0.0.1:6385> redis-cli -a abc123 -p 6385 -c (error) ERR unknown command 'redis-cli', with args beginning with: '-a' 'abc123' '-p' '6385' '-c' 127.0.0.1:6385> get k2 (error) MOVED 449 192.168.92.129:6381 127.0.0.1:6385> get k1 "v1"
127.0.0.1:6381> shutdown
not connected> quit
[root@localhost ~]# redis-server /myredis/cluster/redisCluster6385.conf
[root@localhost ~]# redis-server /myredis/cluster/redisCluster6386.conf
[root@localhost ~]# ps -ef|grep redis
root 10600 1 0 20:06 ? 00:00:00 redis-server 0.0.0.0:6385 [cluster]
root 10612 1 0 20:06 ? 00:00:00 redis-server 0.0.0.0:6386 [cluster]
root 10633 10202 0 20:06 pts/0 00:00:00 grep --color=auto redis
[root@localhost ~]# redis-cli -a abc123 -p 6385
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
127.0.0.1:6385> get k1
(nil)
127.0.0.1:6385> set k1 v1
OK
127.0.0.1:6385> set k2 v2
(error) MOVED 449 192.168.92.129:6381
127.0.0.1:6385> flushall
OK
127.0.0.1:6385> keys *
(empty array)
127.0.0.1:6385> redis-cli -a abc123 -p 6385 -c
(error) ERR unknown command 'redis-cli', with args beginning with: '-a' 'abc123' '-p' '6385' '-c'
127.0.0.1:6385> get k2
(error) MOVED 449 192.168.92.129:6381
127.0.0.1:6385> get k1
"v1"