Redis study notes ---- Redis Cluster Cluster (a)

1. Redis Cluster Introduction

1.1 Why use Redis-Cluster?
[1] In order to provide a stable business in the high-volume access, clustering is inevitable form of storage
[2] the future trend will be closely integrated cloud big data
[3] only distribution architecture to meet the requirements of
1.2 Redis cluster Setup program:
[1] Twitter developers twemproxy
[2] pea pod development CODIS
[3] Redis official redis-cluste
there are many ways to build a cluster Redis, but later versions support redis3.0 redis-cluster cluster, we need 3 (Master) + 3 (Slave ) at least to establish a cluster. Redis-Cluster-free central structure, and each node is connected to all other nodes. Which redis-cluster architecture as shown in FIG.
Here Insert Picture Description

2. Redis Cluster Cluster Features

[1] All of the nodes are interconnected and redis (PING-PONG mechanism), the internal transmission speed using the binary protocol and bandwidth optimization.
[2] nodes fail is to take effect only if the failure by the super cluster node detects a half.
[3] and redis client node is connected, without an intermediate proxy layer, the client need not be connected to all cluster nodes, any node can be used to connect a cluster.
[4] redis-cluster mapping all of the physical node to [0-16383] a slot (not necessarily evenly distributed), Cluster loser Maintenance
[. 5] Redis 16384 Cluster good hash pre-separation grooves, when necessary Redis when placing a key-value clusters, the use of the first key Redis CRC16 algorithm calculates a result, and the results of the remainder number of 16384, such that each key will correspond to a hash slot number between 0-16383, Redis based node an approximately equal number of grooves hidden hash incident on different nodes

3. Redis Cluster Fault Tolerance

3.1 Resilience:
It is the ability to recover from the hair concurrent errors in software or hardware error detection software application running, it can often be measured from the aspects of reliability, availability, scalability, systems and the like.
3.2 redis-cluster fault tolerance is achieved by voting
[1] voting process is the cluster master all involved, if more than half of the master node and master node communication timeout (cluster-node-timeout), that the current master node hang
[2 ] when the entire cluster is unavailable (cluster_state: fail)?
If any master cluster hang up, and the current master no slave, the cluster fail to enter the state, can be understood as a cluster of slot insinuate [0-16383] enters fail when incomplete state, if more than half of master hang up, regardless of whether slave, enter the cluster fail state
Here Insert Picture Description

4. redis-cluster node allocation

(The official recommended) three main nodes are: A, B, C three nodes, they can be three ports on a machine, it can be three different servers, then. In hashed slots (the hash slot) ways to allocate 16,384 slot, they are three nodes slot interval is assumed
node A cover 0-5460
Node B coverage 5461-10922
node C covers 10923-16383
If we add a master nodes D, this approach is redis-cluster from the front part of the respective nodes of each slot pick D placed on
node a covering 1365-5460
node B coverage 6827-10922
node C covers 12288-16383
node D covered 0-1364 5461-6826 10923-12287

summary

Here are some basic concepts Redis Cluster cluster, the next section we will learn how to build on the relevant redis.

Published 58 original articles · won praise 2 · Views 4463

Guess you like

Origin blog.csdn.net/TheWindOfSon/article/details/104664448