A brief introduction to the Redis cluster architecture and design mechanism

Source: Internet
Author: User
Tags redis cluster

Another article introduced the Redis Cluster (link, in the latter part of the article)

See this article today, briefly say (http://hot66hot.iteye.com/blog/2050676)

The author's goal: Redis Cluster would support up to ~1000 nodes. Praise...

Current Redis-supported cluster features (tested):

1): Automatic node discovery

2): Slave->master election, cluster fault tolerance

3): Hot resharding: Online sharding

4): Cluster Management: Cluster XXX

5): Configuration-based (nodes-port.conf) cluster management

6): ASK steering/moved steering mechanism.

1) Redis-cluster Frame composition

Architectural Details:

(1) all Redis nodes are interconnected (the ping-pong mechanism), using binary protocols internally to optimize transmission speed and bandwidth.

(2) the fail of a node is only effective when it is detected by more than half of the master nodes in the cluster.

(3) The client is directly connected to the Redis node and does not require an intermediate proxy layer. The client does not need to connect to all nodes in the cluster and connects to any of the available nodes in the cluster

(4) Redis-cluster maps all the physical nodes to the [0-16383]slot , cluster is responsible for maintaining Node<->slot<->key

2) Redis-cluster election: Fault tolerance

(1) The election process is all master in the cluster, if more than half of the master node communicates with the failed node (cluster-node-timeout), the node is considered to be faulty, and the failover operation is automatically triggered.

(2): When is the entire cluster unavailable (Cluster_state:fail)?

A: If the cluster any master hangs, and the current master does not have slave. The cluster enters the fail state, which can also be understood as the cluster's slot mapping [0-16383] is incomplete when it enters the fail state.

Ps:redis-3.0.0.rc1 joins the Cluster-require-full-coverage parameter, which is turned off by default and the cluster compatibility section fails to open.

B: If more than half of the cluster master hangs, regardless of whether there is a slave cluster into the fail state.

PS: When the cluster is unavailable, all operations on the cluster are not available, received ((error) Clusterdown the cluster is down) error

II: Use of Redis cluster

Ignore. Now the basic use of a single version of Redis, through the Master-slave + (Partition or pre-sharding) way to do. Very good.

Redis-cluster some pits on the client.

1) Slave does not accept any read and write operations by default in the cluster environment, after slave executes the readonly command, the read operation can be performed

2) client side does not support multi-key operation (Mget,mset, etc.), but when the keys set corresponding slot supports Mget operation, see: Hash_tag

3) does not support multiple databases, only one Db,select 0.

4) Jediscluster does not have an API for byte[] and needs to expand itself (attachment is my add-on byte[-based Binaryjediscluster API)

A brief introduction to the Redis cluster architecture and design mechanism

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.