Prepare 6 instances:
10.0.0.12
10.0.0.13
10.0.0.14
10.0.0.16
10.0.0.18
10.0.0.19
Cd/tmp
wget http://download.redis.io/releases/redis-3.2.0.tar.gz
TAR-ZXVF redis-3.2.0.tar.gz
CD redis-3.2.0/
Make Prefix=/opt/redis-cluster
Make Prefix=/opt/redis-cluster Install
Mkdir-p/opt/redis-cluster/var
Mkdir-p/opt/redis-cluster/etc
rsync-avz/tmp/redis-cluster/src/redis-trib.rb/opt/redis-cluster/bin/
/OPT/REDIS-CLUSTER/BIN/REDIS-TRIB.RB Create--replicas 1 10.0.0.12:7000 10.0.0.13:7000 10.0.0.14:7000 10.0.0.16:7000 10.0.0.18:7000 10.0.0.19:7000
startup script, Chkconfig--add redis-node;chkconfig Redis-node on
Test:
/opt/redis-cluster/bin/redis-cli-c-H 10.0.0.12-p 7000
10.0.0.12:7000> Get Nmane
-Redirected to Slots [3677] located at 10.0.0.19:7000
(nil)
10.0.0.19:7000> Select 1
(Error) ERR SELECT is no allowed in cluster mode
10.0.0.19:7000>
Attachment Download: http://down.51cto.com/data/2226906
Centos6.5 Building a Redis cluster