centOS搭建Redis集群时遇到的问题

1.Redis的保护模式

针对之前Redis版本,默认无bind和密码设置存在很大安全风险;Redis3.2版本提出新特性protected mode(保护模式)。
如果Redis在启动时,未开启bind和密码设置功能,只能通过回环地址本地访问,如果尝试远程访问redis,会提示以下错误:

DENIED Redis is running protected mode because protected mode is enabled,
no bind address was specified, no authentication password is requested to clients.

In this mode connections are only accepted from the loopback interface.

1)关闭保护模式


protected-mode no

2)绑定服务器ip


同时注释掉  bind 127.0.0.1

3)设置口令

集群中得各个节点均要设置且密码相同


打开注释,设置自己的密码

创建集群的命令

./redis-trib.rb create --replicas 1 192.168.150.128:7001 192.168.150.128:7002 192.168.150.128:7003 192.168.150.128:7004 192.168.150.128:7005 192.168.150.128:7006

不要使用127.0.0.1进行创建集群

2.第二次构建集群时注意的问题

1)删除各个节点的node.conf文件

2)登录各个节点的客户端执行 flushall 命令

3)执行集群创建命令

3.Could not get a resource from the pool问题

1)集群节点配置中没有注释掉bind 127.0.0.1

2)创建集群时用了127.0.0.1进行了创建



猜你喜欢

转载自blog.csdn.net/jhon1994/article/details/80383494
今日推荐