In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
What is a redis-cluster cluster? I believe that most people do not understand, in order to let you better understand, the editor summed up the following content, do not say much, let's look down together.
Different from master-salve or Sentinel cluster, the biggest difference is that the first two are full storage memory consumption, and there is a bucket effect, while cluster cluster is distributed storage, that is, each Redis stores different content.
Redis-cluster is designed to have a total of 16384 hash slot available, and each master gets a portion of the slot whose distribution algorithm is: [hash_slot = crc16 (key) mod 16384] if there is {}, take the available key of {}, otherwise the whole can be available key. The cluster must have at least 3 masters and 3 slaves, and each instance uses a different profile.
All redis nodes are interconnected with each other (PING-PONG mechanism), and binary protocols are used internally to optimize transmission speed and bandwidth.
The fail of a node takes effect only when it is detected by more than half of the nodes in the cluster.
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 the nodes in the cluster, but to any of the available nodes in the cluster.
Redis-cluster maps all physical nodes to [0-16383] slot, and cluster is responsible for maintaining nodeslotvalue
Redis-cluster voting: fault tolerance
1. All the master in the cluster participate in the voting process. If more than half of the master nodes time out to communicate with the master nodes (cluster-node-timeout), the current master nodes are considered to be dead.
2. When is the entire cluster unavailable (cluster_state:fail)?
If any master of the cluster is down, and the current master has no slave. When a cluster enters the fail state, it can also be understood as entering the fail state when the cluster's slot mapping [0-16383] is incomplete.
Redis-3.0.0.rc1 adds the cluster-require-full-coverage parameter, which is disabled by default, but failed to open the cluster compatibility part.
If more than half of the cluster master is down, regardless of whether there is slave or not, the cluster enters the fail state.
In redis-cluster architecture, redis-master nodes are generally used to receive reads and writes, while redis-slave nodes are generally only used for backup. They have the same slot set as the corresponding master. If a redis-master fails unexpectedly, then upgrade its corresponding slave to temporary redis-master.
In the official document of redis, there is a note on redis-cluster architecture: under cluster architecture, by default, redis-master is used to receive reads and writes, while redis-slave is used for backup. When a request is initiated to slave, it will be directly redirected to the master where the corresponding key is located for processing.
But if you don't mind reading data that may expire in redis-cluster and are not interested in write requests, you can also set slave to readable through the readonly command, and then get the relevant key through slave to achieve read-write separation.
After reading the above, do you have a general understanding of redis-cluster cluster? If you want to know more about the content of the article, welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.