Redis-cluster use of the Mission 800 operation and maintenance work summary

Source: Internet
Author: User
Tags redis cluster install redis

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.