Precautions:
1. If you are building a cluster using the REDIS-TRIB.RB tool, do not configure the password before the cluster is built, and set the password by the config set + config rewrite command on a per machine basis.
2. If the password is set for the cluster, then both Requirepass and Masterauth need to be set, otherwise, when the master-slave switch occurs, it will encounter authorization problem, can simulate and observe the log
3. Each node must have the same password, or redirected will fail
[plain] view plain copy 650) this.width=650; "Src=" https://code.csdn.net/assets/CODE_ Ico.png "width=" "height=" "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" https ://code.csdn.net/assets/ico_fork.svg "width=" "height=" "alt=" derived from My Code slice "style=" border:none; "/>
-
config set masterauth abc
-
config set requirepass abc
-
config rewrite
-
After setting the password, redis-trib.rb check 192.168.0.107:6379
After setting the password, redis-trib.rb check 192.168.0.107:6379 the error connection is not on the instance, the workaround:
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",
:p ort = 6379,
:p ath = nil,
: Timeout = 5.0,
:p assword = "Gh*8pass",
:d B = 0,
:d river = nil,
: id = nil,
: tcp_keepalive = 0,
: reconnect_attempts = 1,
: Inherit_socket = False
}
Modify the default password to do it.
This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1827851
Redis Cluster Setup Password detailed