使用 redis-trib.rb 创建集群时出现连接错误? [英] Getting a connection error when using redis-trib.rb to create a cluster?

查看:234
本文介绍了使用 redis-trib.rb 创建集群时出现连接错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的 Redis 服务器都是这样配置的:

大师:192.168.0.106:7001、192.168.0.105.7001、192.168.0.112:7001

奴隶:192.168.0.106:7002、192.168.0.105:7002、192.168.0.122:7002

其中192.168.0.106:7002服务器是192.168.0.106:7001服务器的从机等等.我让所有服务器都在运行,并且可以对所有服务器执行 redis-cli.我也可以看到 17001 和 17002 端口打开了.但是当我跑步时:

./redis-trib.rb create --replicas 1 192.168.0.106:7001 192.168.0.105:7001 192.168.0.112:7001 192.168.0.106:70.0.102.100.102.100.102.100.10.100.100.10.100.100.100.100.100.105:7001 192.168.0.105:7001 192.168.0.112:7001

我收到一个错误:

创建集群

[ERR] 抱歉,无法连接到节点 192.168.0.106:7001

当所有服务器都在工作并且它们的端口都打开时,我不知道如何解决这个问题?

有一件事是我确实用密码保护了主人.也许 redis-trib.rb 无法处理受密码保护的服务器?

解决方案

redis-trib.rb 无法处理受密码保护的 Redis 节点.

因此尝试在此类节点上使用它会导致 [ERR] 抱歉,无法连接到节点.

为什么 redis-trib.rb 实用程序不处理经过身份验证的节点?

这与以下事实有关:当 Redis 节点受密码保护时,只有其主端口(默认为 6379)上的通信受到保护.集群总线上的通信(默认端口 + 10000 = 16379),其中集群中的节点相互通信不受保护.因此,当单个节点受密码保护时,Redis 集群并没有真正受密码保护.因此,在 Redis 集群中的各个 Redis 节点上设置密码几乎不会增加安全价值.因此 redis-trib.rb 实用程序没有实现任何身份验证.

更多信息在这里:

https://groups.google.com/forum/#!主题/redis-db/Z8lMxTfDct8

I have all my Redis servers configured like this:

Masters: 192.168.0.106:7001, 192.168.0.105.7001, 192.168.0.112:7001

Slaves: 192.168.0.106:7002, 192.168.0.105:7002, 192.168.0.122:7002

Where the 192.168.0.106:7002 server is a slave of the 192.168.0.106:7001 server and so on. I have all servers up ana running and can do redis-cli to all of them. I can see the 17001 and 17002 ports open too. But when I run:

./redis-trib.rb create --replicas 1 192.168.0.106:7001 192.168.0.105:7001 192.168.0.112:7001 192.168.0.106:7002 192.168.0.105:7002 192.1268.0.112:7002

I get an error:

Creating cluster

[ERR] Sorry, can't connect to node 192.168.0.106:7001

I have no idea how to troubleshoot this when all servers are working and their ports are open?

One thing is that I do have the masters protected with a password. Maybe redis-trib.rb is not able to handle servers which are password protected?

解决方案

redis-trib.rb cannot handle Redis nodes which are password-protected.

So trying to use it on such nodes would result in [ERR] Sorry, can't connect to node.

Why the redis-trib.rb utility does not handle authenticated nodes?

It has to do with the fact that when a Redis node is password protected only the communication on its main port (by default 6379) is protected. The communication on its cluster bus (Default Port + 10000 = 16379), where nodes in a cluster communicated with each other is not protected. So a Redis cluster is not really password-protected when individual nodes are. So having a password on individual Redis nodes in a Redis cluster adds little security value. Therefore the redis-trib.rb utility has not implemented any authentication.

More information here:

https://groups.google.com/forum/#!topic/redis-db/Z8lMxTfDct8

这篇关于使用 redis-trib.rb 创建集群时出现连接错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆