Why does a redis cluster need at least 6 nodes
Why does a redis cluster need at least 6 nodes? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Think about it, you can create a redis cluster through redis-trib.rb, and then use the number followed by-- replicas to indicate that one master node corresponds to several slave nodes, so I did the following test.
The effect you want to achieve is that there are 6 nodes, then 2 master nodes, and each master node corresponds to 2 slave nodes, which is exactly 6 nodes, but an error is reported during execution:
[aiprd@hadoop2 src] $. / redis-trib.rb create-- replicas 2 192.168.30.10 Vol 7000 192.168.30.11 RV 7003 192.168.30.10 Rd 7002 192.168.30.10 Rd 7002 192.168.30.11 Rd 7004 192.168.30.11 Rd 7005
> Creating cluster
* * ERROR: Invalid configuration for cluster creation.
* Redis Cluster requires at least 3 master nodes.
* This is not possible with 6 nodes and 2 replicas per node. # explains that for 6 nodes, it is impossible to have 3 master, each with 2 replica nodes. Because that kind of structure requires nine nodes.
* At least 9 nodes are required. # at least 9 nodes are required.
The above information means that the Redis cluster needs at least 3 master nodes, so now there are a total of 6 nodes, so it can only be the way that 1master corresponds to 1slave.
So:
1MasterMel 1slaveRedis cluster needs 6 nodes
1masterly2slaverecoveryredis cluster needs 9 nodes, and so on.
For more information:
Why the maximum number of slots in a redis cluster is 16384
Why should redis sentinel Cluster have more than 3 nodes?
This is the answer to the question about why the redis cluster needs at least 6 nodes. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.