1. Preparation
1>redis-3.0 Tar Package
2>yum Ruby Rubygem
Tip: When installing Rubygem, it may be necessary to install Ruby-rdoc and then perform Ruby setup.rb and Gem install-l redis ①
② installation of Redis, first decompression, into the RDIs installation directory, Make&make install&make Test,make process need to ensure that tcl1.85 version above
2.6 machines currently selected, port default. Three master with three slave (if on a machine, modify port)
Modify Redis.conf
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly
yes
cluster-config-file不需要自己手工创建,启动服务会自动创建。
3.启动集群
1>首先在各机器启动redis server
2>在安装rubygem的机器上执行./src/redis-trib.rb create --replicas 1 hostname:port……
4.异常检查
1>hostname最好是用ip
2>执行
redis-trib.rb create命令报错,需删掉cluster-config-file文件,重启各机器redis server,然后再执行
redis-trib.rb create
Redis Cluster Cluster Build deployment