One, the company is now using the cluster scheme (REDIS+SENTINEL)
Monitoring a Redis cluster together with multiple Sentinel detects that Master is not available and polls to determine if master needs to switch. Sentinel detects each other (by writing information in the co-detected master), Sentinel only needs to configure the master node to automatically get the list of connected slave through master. When one of the Sentinel detects master down, it marks master as Sdown and sends the Sentinel IS-MASTER-DOWN-BY-ADDR command to the other Sentinel to vote, and the poll is identified as Odown , start selecting a new master, and switch.
Disadvantages:
1. There are no suitable clients that need to handle various events on their own.
2. There is no release yet.
Second, open-source twemproxy cluster solution by Twitter
Mainly by Twemproxy as a proxy, to accept the access of multiple programs, in accordance with the routing rules, forwarded to the background of the various Redis servers, back to the original path, this solution to a single Redis instance load capacity problems.
Of course, Twemproxy itself is a single point, need to use keepalived to do high-availability programs.
Disadvantages:
cannot be expanded or scaled smoothly. This leads to a sudden increase in business volume, the need to add Redis servers, shrinking business, the need to reduce Redis server, for Twemproxy, is basically difficult to operate.
Three, Codis Redis (open source by pea pods) based on go and C development
(1) Architecture
Codis introduced the group concept, with each group consisting of 1 Redis master and at least one Redis Slave, which is one of the differences with Twemproxy. The advantage of this is that if there is a problem with the current master, the OPS person can switch to slave by dashboard "self-service" without having to modify the program configuration file carefully.
CODIS also supports data thermal migration (Auto Rebalance), where the producer modifies the Redis server source code and calls it Codis server.
The CODIS uses a pre-shard (pre_sharding) mechanism, which is pre-defined, divided into 1024 slots (that is, up to 1024 CODIS servers in the backend), which are stored in zookeeper, Zookeeper also maintains Codis Server Group information and provides services such as distributed locks.
650) this.width=650; "Src=" http://cdn.infoqstatic.com/statics_s2_20150424-0221/resource/articles/ Effective-ops-part-03/zh/resources/0331022.png "width=" "style=" height:auto;vertical-align:middle;border:0px; margin:0px Auto;color:rgb (85,85,85); font-family: ' Microsoft yahei ', ' Helvetica Neue ', Helvetica, Arial, Sans-serif; Font-size:15px;line-height:26px;text-indent:30px;white-space:normal;background-color:rgb (255,255,255); "/>
(2) The use of skills, precautions
1, seamless migration twemproxy
Using the Codis-port tool, you can achieve synchronization of the Twemproxy under the RDIs data to your CODIS cluster, after the synchronization is complete, only need to modify the program configuration file, the Twemproxy address to the CODIS address can be changed.
2, HA for Java program support
CODIS provides a Java client and is called Jodis so that if a single Codis proxy goes down, Jodis automatically discovers it and automatically avoids it, leaving the business unaffected.
3, Support pipeline
Pipeline allows the client to make a batch of requests and get the return result of the request at once, which increases the CODIS's imaginary space.
4,codis is not responsible for master-slave synchronization
Codis is only responsible for maintaining the current Redis server list, by the OPS personnel to ensure the consistency of master-slave data
5, to improve the place
Add pipeline parameter, value length if large, performance is rather lower than twemproxy
Source Address: Https://github.com/wandoulabs/codis
This article is from the "Henry" blog, please be sure to keep this source http://dihaifeng.blog.51cto.com/8814208/1713540
Redis Cluster Scenario Summary