In fact, you can see Redis-cluster or codis or in fact the most fundamental principle almost consistent, there are slots concept, data stored in these hash slots
Various shortcomings
There are proxies in different points codis, the master-slave switch in each group is not automatic, and the dependence on zookeeper is too strong.
Rediscluster cluster requirements are too stringent, while hanging off 2 shard cluster is not available, while the 2 group of the master cluster is unavailable
Yum Install Ruby
Gem Install Redis
1. Create a Redis cluster
./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
2. View the hash slot range for each slice of the Redis cluster, as well as the master-slave port
Cluster slots
3.cluster nodes
4.cluster Info
5. Adding nodes
./redis-trib.rb add-node 127.0.0.1:7006 127.0.0.1:7000 add 7006 to the Redis cluster cluster
6. Turn 7006 into the master
(1)./redis-trib.rb Add-node 127.0.0.1:7006 127.0.0.1:7000
(2) redis-trib.rb Reshard 127.0.0.1:7000
Select how many hash slots to migrate
Select the node ID to accept these hash slots
Choose which nodes to migrate these hash slots from
7. Turn 7007 from
(1)./redis-trib.rb Add-node 127.0.0.1:7006 127.0.0.1:7000
(2)./REDIS-CLI-C-P 7007 cluster replicate 8AEC0832EFD55A147B074384EDEE65A650F770D8 (Master Node ID)
8. Delete a node
./redis-trib.rb Del-node 127.0.0.1:7000 dfdbf87d0fb7db46922e2a0301eb3db9a9d02cc5
Redis-cluster use of the Mission 800 operation and maintenance work summary