离线安装Redis并构建RedisCluster集群
# --replicas 则指定了为Redis Cluster中的每个Master节点配备几个Slave节点 $ redis-trib.rb create --replicas 1 192.168.10.111:7000 192.168.10.111:7001 192.168.10.112:7002 192.168.10.112:7003192.168.10.113:7004 192.168.10.113:7005
>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
192.168.10.113:7004
192.168.10.112:7002
192.168.10.111:7000
Adding replica 192.168.10.112:7003 to 192.168.10.113:7004
Adding replica 192.168.10.113:7005 to 192.168.10.112:7002
Adding replica 192.168.10.111:7001 to 192.168.10.111:7000
M: 985750026ac9434fab986b54a2a258089d171617 192.168.10.111:7000
slots:10923-16383 (5461 slots) master
S: bd77f34d038d05e9a586dacd447bc10d7472ccb1 192.168.10.111:7001
replicates 985750026ac9434fab986b54a2a258089d171617
M: 598a585000c07354483019cd3561fb1c6ddcb755 192.168.10.112:7002
slots:5461-10922 (5462 slots) master
S: c0ab83ae1a8ef4b9c450ae6538ee568fa2a1d1a9 192.168.10.112:7003
replicates 3b18cf1ca717226e73664a0025cd572b798655bc
M: 3b18cf1ca717226e73664a0025cd572b798655bc 192.168.10.113:7004
slots:0-5460 (5461 slots) master
S: f140afda21eba172b8a07229c78f090d9b062e8e 192.168.10.113:7005
replicates 598a585000c07354483019cd3561fb1c6ddcb755
Can I set the above configuration? (type 'yes' to accept): yes #在此处输入“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 192.168.10.111:7000)
M: 985750026ac9434fab986b54a2a258089d171617 192.168.10.111:7000
slots:10923-16383 (5461 slots) master
M: bd77f34d038d05e9a586dacd447bc10d7472ccb1 192.168.10.111:7001
slots: (0 slots) master
replicates 985750026ac9434fab986b54a2a258089d171617
M: 598a585000c07354483019cd3561fb1c6ddcb755 192.168.10.112:7002
slots:5461-10922 (5462 slots) master
M: c0ab83ae1a8ef4b9c450ae6538ee568fa2a1d1a9 192.168.10.112:7003
slots: (0 slots) master
replicates 3b18cf1ca717226e73664a0025cd572b798655bc
M: 3b18cf1ca717226e73664a0025cd572b798655bc 192.168.10.113:7004
slots:0-5460 (5461 slots) master
M: f140afda21eba172b8a07229c78f090d9b062e8e 192.168.10.113:7005
slots: (0 slots) master
replicates 598a585000c07354483019cd3561fb1c6ddcb755
All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
All 16384 slots covered.
页:
[1]