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