- [redistest@ip-172-18-98-136 redis]$ ./redis-trib.rb create --replicas 1 192.8.8.136:7000 192.8.8.137:7001 192.8.8.138:7002 192.8.8.137:7002 192.8.8.136:7001 192.8.8.138:7000>>> Creating cluster>>> Performing hash slots allocation on 6 nodes...
- Using 3 masters:
- 192.8.8.138:7002
- 192.8.8.137:7001
- 192.8.8.136:7000
- Adding replica 192.8.8.137:7002 to 192.8.8.138:7002
- Adding replica 192.8.8.138:7000 to 192.8.8.137:7001
- Adding replica 192.8.8.136:7001 to 192.8.8.136:7000
- M: 6780f0fadd82825d04e524fd81fa710403e7152e 192.8.8.136:7000
- slots:10923-16383 (5461 slots) master
- M: b00521fd8b0fae93d9e56fa6afe505ec9574c399 192.8.8.137:7001
- slots:5461-10922 (5462 slots) master
- M: 6f9c383ec47461c2a86265f5db506e10397605d8 192.8.8.138:7002
- slots:0-5460 (5461 slots) master
- S: fc510e5cdcc78a42ef871251736d365db5311c7f 192.8.8.137:7002
- replicates 6f9c383ec47461c2a86265f5db506e10397605d8
- S: 6e4ae3851e018c08ba5cec96f113815db1931b4d 192.8.8.136:7001
- replicates 6780f0fadd82825d04e524fd81fa710403e7152e
- S: 5b39cd3bd706d30b5470089f71bd29738b306d3b 192.8.8.138:7000
- replicates b00521fd8b0fae93d9e56fa6afe505ec9574c399
- 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 192.8.8.136:7000)
- M: 6780f0fadd82825d04e524fd81fa710403e7152e 192.8.8.136:7000
- slots:10923-16383 (5461 slots) master
- M: b00521fd8b0fae93d9e56fa6afe505ec9574c399 192.8.8.137:7001
- slots:5461-10922 (5462 slots) master
- M: 6f9c383ec47461c2a86265f5db506e10397605d8 192.8.8.138:7002
- slots:0-5460 (5461 slots) master
- M: fc510e5cdcc78a42ef871251736d365db5311c7f 192.8.8.137:7002
- slots: (0 slots) master
- replicates 6f9c383ec47461c2a86265f5db506e10397605d8
- M: 6e4ae3851e018c08ba5cec96f113815db1931b4d 192.8.8.136:7001
- slots: (0 slots) master
- replicates 6780f0fadd82825d04e524fd81fa710403e7152e
- M: 5b39cd3bd706d30b5470089f71bd29738b306d3b 192.8.8.138:7000
- slots: (0 slots) master
- replicates b00521fd8b0fae93d9e56fa6afe505ec9574c399
- [OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...
- [OK] All 16384 slots covered.
来源: http://www.linuxidc.com/Linux/2018-03/151185.htm