1.如果是使用redis-trib.rb工具构建集群,集群构建完成前不要配置密码,集群构建完毕再通过config set + config rewrite命令逐个机器设置密码
2.如果对集群设置密码,那么requirepass和masterauth都需要设置,否则发生主从切换时,就会遇到授权问题,可以模拟并观察日志
3.各个节点的密码都必须一致,否则Redirected就会失败
config set masterauth abc
config set requirepass abc
config rewrite
设置密码后,redis-trib.rb check 192.168.0.107:6379
设置密码后,redis-trib.rb check 192.168.0.107:6379 报错连接不上实例,解决方法:
vim /usr/lib/ruby/gems/1.8/gems/redis-3.3.0/lib/redis/client.rb
class Redis
class Client
DEFAULTS = {
:url => lambda { ENV["REDIS_URL"] },
:scheme => "redis",
:host => "127.0.0.1",
:port => 6379,
:path => nil,
:timeout => 5.0,
:password => "gh*8pass",
:db => 0,
:driver => nil,
:id => nil,
:tcp_keepalive => 0,
:reconnect_attempts => 1,
:inherit_socket => false
}
修改下默认密码就可以了
阅读(450) | 评论(0) | 转发(0) |