redis创建集群至少需要几个节点?至少需要几个master节点?

描述

  这也算个思考吧,通过redis-trib.rb可创建redis集群,然后通过--replicas后面接的数字,表示1个主节点对应几个从节点,那么我就做了如下的测试,想要达到的效果就是有6个节点,然后2个master节点,每个master节点对应2个slave节点,不就正好是6个节点了吗,但是在执行的时候报错:

[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
>>> 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.  #解释了,对于6个节点,不可能是3个master,每个有2个副本节点。因为,那样的结构需要9个节点。
*** At least 9 nodes are required.                              #至少需要9个节点。

 以上信息的意思是:Redis集群至少需要3个master节点,所以现在总共有6个节点,就只能是1master对应1slave这种方式。

所以:

  1master-1slave,redis集群需要6个节点

  1master-2slave,redis集群需要9个节点,以此类推。

文档创建时间:2019年8月2日12:40:04

原文地址:https://www.cnblogs.com/chuanzhang053/p/11287936.html