Official Information https://redis.io/topics/cluster-tutorial,
First download redis,http://download.redis.io/releases/redis-4.0.6.tar.gz
Tar zxvf redis-4.0.6.tar.gz
CD redis-4.0.6
Make
Make error GCC diagnostic not allowed inside functions, check the data found to be the GCC version is too low, upgrade GCC, according to this article http://blog.csdn.net/u014028392/article /details/70139152, upgrade to GCC version 4.8.2, re-make, success.
Make a soft chain:
Ln-s Src/redis-server/usr/bin/redis-server
Ln-s SRC/REDIS-CLI/USR/BIN/REDIS-CLI
Create a redis.conf configuration file that writes the following:
Port 7000
cluster-enabled Yes
cluster-config-file nodes.conf
cluster-node-timeout
Yes
Create 6 instances
mkdir cluster-test
cd cluster-test
mkdir 7000 7001 7002 7003 7004 7005
Copy the configuration file to the directory for each instance:
CP redis.conf Cluster-test/7000/
CP redis.conf cluster-test/7001/... The redis.conf port in each instance directory is then modified to the port of the corresponding instance, for example, 7001 directory configuration file is changed to Port 7001 to start 6 instances: cd cluster-test/7000/&& redis-server. Redis.conf next create cluster, need Ruby version 2.3.1 above,
ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.3.1.tar.gz Download the latest Ruby installation package ruby-2.3.1.tar.gz
Gem Update--system upgrade to the latest version 2.5.1
Gem install Redis installation Redis module
This will be an error cannot connect to the gem source, can not be connected to the official source of foreign countries, may be provided by Taobao
Gem sources remove http://rubygems.org/
Gem Sources-a https://ruby.taobao.org/
This step may error The SSL problem cannot open HTTPS connection, workaround refer to my this article
http://blog.csdn.net/beyondlpf/article/details/51275051
After the installation succeeds, execute the Create command:
./redis-trib.rb Create--replicas 1 127.0.0.1:7000 127.0.0.1:7001
127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
Create complete after entering Yes