Home  >  Article  >  Database  >  Why does a redis cluster require at least 6 nodes?

Why does a redis cluster require at least 6 nodes?

(*-*)浩
(*-*)浩Original
2019-11-02 11:47:3610747browse

Why does a redis cluster require at least 6 nodes?

This is also a thought. You can create a redis cluster through redis-trib.rb, and then use the number after --replicas to indicate how many slave nodes correspond to one master node. , then I did the following test. (Recommended learning: Redis video tutorial)

The desired effect is to have 6 nodes, then 2 master nodes, and each master node corresponds to 2 slave nodes. Isn’t it exactly 6 nodes?, but an error is reported during execution:

[aiprd@hadoop2 src]$ ./redis-trib.rb create --replicas 2 192.168.30.10:7000 192.168.30.11:7003 192.168.30.10:7002 192.168.30.10:7001 192.168.30.11:7004 192.168.30.11:7005<br/>>>> Creating cluster<br/>*** ERROR: Invalid configuration for cluster creation.<br/>*** Redis Cluster requires at least 3 master nodes.<br/>*** This is not possible with 6 nodes and 2 replicas per node.  #解释了,对于6个节点,不可能是3个master,每个有2个副本节点。因为,那样的结构需要9个节点。<br/>*** At least 9 nodes are required.                              #至少需要9个节点。<br/>

The above information means: the Redis cluster requires at least 3 master nodes, so now There are a total of 6 nodes, and the only way is 1 master corresponding to 1 slave.

So:

1master-1slave, the redis cluster requires 6 nodes

1master-2slave, redis The cluster requires 9 nodes, and so on.

The above is the detailed content of Why does a redis cluster require at least 6 nodes?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use redisNext article:How to use redis