In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Redis-Cluster adopts a non-central structure, and each node stores data and the entire cluster state.
All redis nodes are interconnected with each other (PING-PONG mechanism), and binary protocols are used internally to optimize transmission speed and bandwidth.
Redis-cluster maps all nodes to [0-16383] slot (not necessarily evenly distributed), and cluster is responsible for maintaining nodeslotvalue.
The Redis cluster is pre-divided into 16384 buckets. When you need to place a key-value in the Redis cluster, decide which bucket to put a key into according to the value of CRC16 (key) mod 16384.
Slave
The nodes responsible for a certain number of slots are called master nodes, and each master node can be configured with several backup nodes-called slave nodes. The Slave node generally saves the data of the master node as a cold backup and replaces the master node when the master node goes down.
How does the cluster determine whether a node is down:
The first thing to say is that each node has information about all the master nodes and slave nodes of the cluster. The ping-pong of each other is used to determine whether the nodes can be connected. If more than half of the nodes go to ping a node and do not respond, the cluster thinks that the node is down and then connects to its backup node.
The necessary conditions for a cluster to enter the fail state:
When a master node and all slave nodes are dead, our cluster enters the faill state.
If more than half of the cluster master is down, regardless of whether there is slave or not, the cluster enters the fail state.
If any master of the cluster is down, and the current master has no slave. The cluster enters the fail state.
Cluster construction:
The three hosts, the IP are:
192.168.121.121
192.168.121.122
192.168.121.123
The ports on each host are:
7000 and 7001
The cluster needs at least 3 masters
Roles of each node
192.168.121.121v7000 master Master Node
192.168.121.121 slave slave node, which is the slave node of 192.168.121.122VR 7000
192.168.121.122 7000 master master node
192.168.121.122 slave slave node, which is the slave node of 192.168.121.123VR 7000
192.168.121.123VR 7000 master Master Node
192.168.121.123 slave slave node, which is the slave node of 192.168.121.121VR 7000
As can be seen from the above:
Three master master nodes are distributed on three different servers, and three slave slave nodes are distributed on three different servers.
Even if one host is down, the whole cluster will function normally.
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.