Redis Cluster Setup Password detailed

Source: Internet
Author: User
Tags redis cluster

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; "/>

    1. config set masterauth  abc  

    2. config set requirepass abc  

    3. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.