Deployment of a Redis cluster

Source: Internet
Author: User
Tags redis cluster install redis

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

Config set Masterauth 123456 config set requirepass 123456config rewrite


    1. Requires 6 servers

Three main three from

2. Start Redis on each of the three servers

Deploy Redis on each server separately and start up

Requires different configuration file parameters than Redis standalone installation before booting

vi/opt/redids/conf/configuration file

Database 1 #默认有16个库选择一个

cluster-enabled Yes #开启集群

Cluster-config-file #/opt/redis/conf/nodes.conf #开启集群的时候自动生成和redis的配置文件没有任何关系

AppendOnly Yes #开启持久化存储

3. Start all Redis services, start later only to indicate boot but 6 servers do not constitute a cluster # Reference stand-alone deployment

4. Cluster work

1.yum-y Install ruby RubyGems

Gem Install Redis

cp/root/redis-3.2.2/src/redis-trib.rb/opt/redis/bin/#redis Bin directory is already in the environment variable

REDIS-TRIB.RB--replicas 1 ip1:6379 ip2:6379 ip3:6379 ip4:6379 ip5:6379 ip6:6379

--replicas 1 means that a master node has a standby node which means that three main three are

After the end, you will find that the/opt/redis/conf/nodes.conf has generated the information of the cluster.

5. View the status of the cluster

Redis-cli-h IP cluster Nodes

6. Set key value for manual validation



This article is from the "Brick Blog" blog, please be sure to keep this source http://wsxxsl.blog.51cto.com/9085838/1886014

Deployment of a Redis cluster

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.