Redis Redundancy Scheme (keepalived, HAProxy, Redis Sentinel)
If you're looking for a redis redundancy solution, I've found the following scenario, and I think I can try this out.
"highly Available Redis Cluster | Simplicity is the keynote of all true elegance"
Initially, it was considered to be built using pacemaker, because the Redis author launched Sentinel's scenario, so this article uses the Sentinel
Http://www.cnblogs.com/yjmyzz/p/redis-sentinel-sample.html
The Master-slave mode is described in the previous section, where the "full" read/write functionality will be affected in the case of a minimum configuration: master, slave each node, either master or slave down, which is obviously unacceptable in the production environment. Fortunately, Redis provides Sentinel (
1, build Redis-master, Redis-slave and Seninel Sentinel monitoringIn the case of a minimum configuration: master, slave each node, either master or slave down one, the "full" read/write functionality will be affected, which is obviously unacceptable in the production environment. Fortunately, Redis provides Sentinel (Sentinel) mechanism to automatically monitor t
Http://www.cnblogs.com/yjmyzz/p/redis-sentinel-sample.html
The Master-slave mode is described in the previous section, where the "full" read/write feature will be affected, in the case of a minimum configuration: master, slave each node, which is obviously unacceptable in a production environment. Fortunately Redis provides a Sentinel (Sentinel) mechanism,
Redis server/client/sentinel/cluster, redissentinel
Server/client/sentinel/cluster in redis
The redis Server is a one-to-many architecture. The server uses the I/O multiplexing technology to process file events and processes requests from multiple clients in a single thread and single process. struct redisServer {// stores the list * clients;/* List of active clients * // linked list, and stores the list *
Jedis Shard Sentinel Connection Pool experiment 1. CauseAs is known to all, the Redis official Ha Tool Sentinel has been in existence for a long time, but it is puzzling that Jedis officials have been slow to update its connection pool. Until the latest version of 2.7.3 in the Maven library, only shard connection pooling or non-fragmented sentinel connection pool
1. Redis Sentinel FeatureRedis Sentinel is a set of distributed systems for managing Redis instances, with 3 main tasks to complete:1) Monitoring: Continuously monitor whether Redis master or slave instances are running as expected2) Notification: If the monitored Redis instance is running abnormally, Sentinel will notify the external (person or program) via API3
This article uses the version of redis2.8.24;1. Test environmentmaster:192.168.136.130 6379slave1:192.168.136.130 6479slave2:192.168.136.130 6579master-sentinel:192.168.136.1 26579 26379slave1-sentinel:192.168.136.130 26479slave2-sentinel:192.168.136.1302. Download and installAddress: Http://www.redis.io#安装tar zxf redis-2.8.24.tar.gzcd redis-2.8.24make make inst
This paper mainly introduces a high availability scheme of Redis cluster through Jedissentinel, this scheme needs to use Jedis2.2.2 and above (mandatory), Redis2.8 and above (optional, Sentinel first appeared in the Redis2.4, Redis2.8 Sentinel more stable, Redis cluster is a shard (sharding) plus master-slave way to build, to meet the requirements of scalability;About Redis SentinelRedis
Recently saw the Redis automatic Failover Sentinel (Sentinel), so take notes at the second placeNote that in the real world, multiple machines, this article is just testing, so configure multiple Redis instances on a single machine to achieve the purpose of the experiment
Redis Sentinel (Sentinel)
7000 Configuration
Sentinel.conf## --------------------------------------Port 26379Dir/tmp# Sentinel Monitor # Master-name: cannot contain special characters, custom master name# Ip:redis Master IP# Redis-port:redis Master Port# Quorum: Objective down at least multiple sentinel agree# tells Sentinel to monitor this master, and to consider it in O_down# (objectively down) state only
This article describes how to monitor Redis master-slave clusters through Sentinel and automatically switch IP and ports via Jedis.1. Configuring Redis Master-Slave instances10.93.21.21:637910.93.21.21:638910.93.21.21:6399Master-Slave synchronization relationshipmaster:10.93.21.21:6379slave:10.93.21.21:6389,10.93.21.21:6399The master configuration is as follows:10.93. 21.21 6379"/home/data_monitor/redis-3.2.9/log/6379.log"# Persistent data file dirdi
First, Protected-mode
By default, Redis node and Sentinel Protected-mode are yes, and if you want to connect a Redis cluster remotely from a remote connection, you need to modify the Protected-mode of Redis node and Sentinel to No, If you only modify Redis node, you will still not be able to use it from the remote Connection Sentinel, and the
property.LIST-INSERT(L,x)1 x.next=L.head2 if L.head!=NIL3 L.head.prev=x4 L.head=x5 x.prev=NILIt simply inserts an element at the beginning, so time consuming is only
Θ(1)
。DeleteWe have a pointer to x, and then we want to remove the X from the list. Specific ideas are also very simple, such as a, B, and C three nodes, if you want to remove the B, you just need to point A's next to C, if it is a double-line linked list also remember to point C prev t
CommunicationAfter initialization is complete, Sentinel will actively communicate with master, slave, to obtain their information.Get Primary Server informationFirst, Sentinel will establish two connections with master, which are command connections and subscription connections (stored in the CC and PC fields of Sentinelredisinstance, respectively).
The code is as follows
Copy Code
# Redis-sentinel's official website address: Http://redis.io/topics/sentinel # Note: Redis-sentinel website is not a stable version. Personally feel this is much better than Keepalived+redis to switch. Configuration environment: os:centos6.1 x86 * 4 software:redis-2.6.9 Memory: 16G cpu:e5606 @ 2.13GHz *----------------- -IP Distribution: Redis Sentinel : 192.168.
to introduce zookeeper, large changes to existing code)
4.redis+sentinel (Redis self-monitoring middleware) (small code changes, less configuration, and can meet the needs of dual-machine hot standby)
Based on our current situation and requirements, after a brief comparison, our team decided to choose a fourth option Redis+sentinel to achieve dual-machine hot standby. preparatory work 1. Install redis-001
that I am learning.
Redis Sentinel Introduction: (Here copy)
Redis's Sentinel system is used to manage multiple Redis servers (instance), which performs the following three tasks: monitoring (monitoring): Sentinel will constantly check your home server and from the server for proper operation. Reminder (Notification): When a problem occurs on a Redis server t
According to the Sentinel mode document on the Redis website: http://redis.io/topics/sentinel
You can know Sentinel has the ability to monitor automatic failover and provision of configuration information
In the previous document, the master-slave configuration of Redis was described. Now let's go ahead and move on to high availability.
For convenience, the insta
Abstract: sentinel provides a variety of SPI interfaces to provide scalability. You can expand the interface implementation based on the same Sentinel-core, so that you can easily add custom logic to Sentinel. In order to unify the initialization process, the initialization logic extension mechanism abstracts some initialization logic of the initfunc interface, f
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.