redis演练(9) redis Cluster 集群快速部署&failover情况
# ps -ef |grep redisroot 391224440 10:40 pts/0 00:00:00 grep redis
#先执行start,启动6个节点
# ./create-clusterstart
Starting 30001
Starting 30002
Starting 30003
Starting 30004
Starting 30005
Starting 30006
#确认下
# ps -ef |grep redis
root 5189 10 13:58 ? 00:00:00 ../../src/redis-server *:30001
root 5191 10 13:58 ? 00:00:00 ../../src/redis-server *:30002
root 5193 10 13:58 ? 00:00:00 ../../src/redis-server *:30003
root 5201 10 13:58 ? 00:00:00 ../../src/redis-server *:30004
root 5206 10 13:58 ? 00:00:00 ../../src/redis-server *:30005
root 5208 10 13:58 ? 00:00:00 ../../src/redis-server *:30006
root 523524440 13:59 pts/0 00:00:00 grep redis
#6节点纳入集群管理
# ./create-clustercreate
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
127.0.0.1:30001
127.0.0.1:30002
127.0.0.1:30003
Adding replica 127.0.0.1:30004 to 127.0.0.1:30001
Adding replica 127.0.0.1:30005 to 127.0.0.1:30002
Adding replica 127.0.0.1:30006 to 127.0.0.1:30003
M: 7556689b3dacc00ee31cb82bb4a3a0fcda39db75 127.0.0.1:30001
slots:0-5460 (5461 slots) master
M: 29cc0b04ce1485f2d73d36c204530b38c69db463 127.0.0.1:30002
slots:5461-10922 (5462 slots) master
M: 8c8c363fed795d56b319640ca696e74fbbbd3c77 127.0.0.1:30003
slots:10923-16383 (5461 slots) master
S: 6ca5cc8273f06880f63ea8ef9ef0f26ee68677f8 127.0.0.1:30004
replicates 7556689b3dacc00ee31cb82bb4a3a0fcda39db75
S: c47d9b24c51eea56723ebf40b5dd7bb627a0d92d 127.0.0.1:30005
replicates 29cc0b04ce1485f2d73d36c204530b38c69db463
S: e16c5b58943ed11dda1a90e5cacb10f42f4fcc53 127.0.0.1:30006
replicates 8c8c363fed795d56b319640ca696e74fbbbd3c77
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join..
>>> Performing Cluster Check (using node 127.0.0.1:30001)
M: 7556689b3dacc00ee31cb82bb4a3a0fcda39db75 127.0.0.1:30001
slots:0-5460 (5461 slots) master
1 additional replica(s)
S: 6ca5cc8273f06880f63ea8ef9ef0f26ee68677f8 127.0.0.1:30004
slots: (0 slots) slave
replicates 7556689b3dacc00ee31cb82bb4a3a0fcda39db75
S: c47d9b24c51eea56723ebf40b5dd7bb627a0d92d 127.0.0.1:30005
slots: (0 slots) slave
replicates 29cc0b04ce1485f2d73d36c204530b38c69db463
M: 8c8c363fed795d56b319640ca696e74fbbbd3c77 127.0.0.1:30003
slots:10923-16383 (5461 slots) master
1 additional replica(s)
M: 29cc0b04ce1485f2d73d36c204530b38c69db463 127.0.0.1:30002
slots:5461-10922 (5462 slots) master
1 additional replica(s)
S: e16c5b58943ed11dda1a90e5cacb10f42f4fcc53 127.0.0.1:30006
slots: (0 slots) slave
replicates 8c8c363fed795d56b319640ca696e74fbbbd3c77
All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
All 16384 slots covered.
页:
[1]