A total of 6 redis, three masters and three slaves, create directories respectively, 7001, 6002, 7003, 8001, 8002, 8003
Configure the message in the configuration file in the respective directory, modify the corresponding file directory, and start 6 redis services after configuration
Configure cluster
4. View cluster status
redis-cli -p 7001 cluster nodes
Cluster connection redis
redis-cli -c -p 7001
Hash slot Redis will map each master node to 0-16384 slots. The data key is not bound to the node, but to the slot. It will hash according to the key and take the remainder with 16384. as a slot value. As shown below, when accessing node 7003, if the slot of a is at 7003, it can be obtained at node 7003, and the slot of num at 7002 will be redirected to 7002