redis集群及常用的操作命令

最近在研究redis集群的搭建,在此做一个总结

[root@localhost src]#  ./redis-trib.rb create --replicas 1  127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
>>> Creating cluster
Connecting to node 127.0.0.1:7000: OK
Connecting to node 127.0.0.1:7001: OK
Connecting to node 127.0.0.1:7002: OK
Connecting to node 127.0.0.1:7003: OK
Connecting to node 127.0.0.1:7004: OK
Connecting to node 127.0.0.1:7005: OK
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
127.0.0.1:7000
127.0.0.1:7001
127.0.0.1:7002
Adding replica 127.0.0.1:7003 to 127.0.0.1:7000
Adding replica 127.0.0.1:7004 to 127.0.0.1:7001
Adding replica 127.0.0.1:7005 to 127.0.0.1:7002
M: ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a 127.0.0.1:7000
   slots:0-5460 (5461 slots) master
M: d3058a19483d7be5c30c042779e56130f6ebf074 127.0.0.1:7001
   slots:5461-10922 (5462 slots) master
M: 5814305e71552ab45c44b9b8233681a63c3a57b1 127.0.0.1:7002
   slots:10923-16383 (5461 slots) master
S: e50676757acbe7c6a21e8abf4eda26ababb08285 127.0.0.1:7003
   replicates ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a
S: ab307ba26d6dabe8edb2f2a7287be6f01aa46d88 127.0.0.1:7004
   replicates d3058a19483d7be5c30c042779e56130f6ebf074
S: 11174332eb6ad40c0327750536fa776d706caf85 127.0.0.1:7005
   replicates 5814305e71552ab45c44b9b8233681a63c3a57b1
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:7000)
M: ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a 127.0.0.1:7000
   slots:0-5460 (5461 slots) master
M: d3058a19483d7be5c30c042779e56130f6ebf074 127.0.0.1:7001
   slots:5461-10922 (5462 slots) master
M: 5814305e71552ab45c44b9b8233681a63c3a57b1 127.0.0.1:7002
   slots:10923-16383 (5461 slots) master
M: e50676757acbe7c6a21e8abf4eda26ababb08285 127.0.0.1:7003
   slots: (0 slots) master
   replicates ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a
M: ab307ba26d6dabe8edb2f2a7287be6f01aa46d88 127.0.0.1:7004
   slots: (0 slots) master
   replicates d3058a19483d7be5c30c042779e56130f6ebf074
M: 11174332eb6ad40c0327750536fa776d706caf85 127.0.0.1:7005
   slots: (0 slots) master
   replicates 5814305e71552ab45c44b9b8233681a63c3a57b1
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.


你可能感兴趣的:(linux)