saltstack之redis集群创建
# salt 'master1' cmd.run 'echo yes|/ane/soft/redis-3.2.1/src/redis-trib.rb create --replicas 1 172.16.77.160:6379 172.16.77.160:6380 172.16.77.160:6381 172.16.77.162:6379 172.16.77.162:6380 172.16.77.162:6381' master1:>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
172.16.77.160:6379
172.16.77.162:6379
172.16.77.160:6380
Adding replica 172.16.77.162:6380 to 172.16.77.160:6379
Adding replica 172.16.77.160:6381 to 172.16.77.162:6379
Adding replica 172.16.77.162:6381 to 172.16.77.160:6380
M: 1ef26e8ddcd56d22f66b1270e0f29cf319b6305c 172.16.77.160:6379
slots:0-5460 (5461 slots) master
M: 0cd4d5ecdecc538e76c6b3d0cfa689cb40f7e573 172.16.77.160:6380
slots:10923-16383 (5461 slots) master
S: 07b6124f057e12fc78833be31757413de01f6368 172.16.77.160:6381
replicates e4d5bdc8815126789cc8935cec5be3380f7e68d4
M: e4d5bdc8815126789cc8935cec5be3380f7e68d4 172.16.77.162:6379
slots:5461-10922 (5462 slots) master
S: 6cafd239cff892c4e587b14d5cc5619cb3a97277 172.16.77.162:6380
replicates 1ef26e8ddcd56d22f66b1270e0f29cf319b6305c
S: cb31f41ffe6ff356b65727b1dc3d5fdc14378c45 172.16.77.162:6381
replicates 0cd4d5ecdecc538e76c6b3d0cfa689cb40f7e573
Can I set the above configuration? (type 'yes' to accept): >>> 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 172.16.77.160:6379)
M: 1ef26e8ddcd56d22f66b1270e0f29cf319b6305c 172.16.77.160:6379
slots:0-5460 (5461 slots) master
M: 0cd4d5ecdecc538e76c6b3d0cfa689cb40f7e573 172.16.77.160:6380
slots:10923-16383 (5461 slots) master
M: 07b6124f057e12fc78833be31757413de01f6368 172.16.77.160:6381
slots: (0 slots) master
replicates e4d5bdc8815126789cc8935cec5be3380f7e68d4
M: e4d5bdc8815126789cc8935cec5be3380f7e68d4 172.16.77.162:6379
slots:5461-10922 (5462 slots) master
M: 6cafd239cff892c4e587b14d5cc5619cb3a97277 172.16.77.162:6380
slots: (0 slots) master
replicates 1ef26e8ddcd56d22f66b1270e0f29cf319b6305c
M: cb31f41ffe6ff356b65727b1dc3d5fdc14378c45 172.16.77.162:6381
slots: (0 slots) master
replicates 0cd4d5ecdecc538e76c6b3d0cfa689cb40f7e573
All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
All 16384 slots covered.
页:
[1]