码迷,mamicode.com
首页 > 其他好文 > 详细

Redis 3.2.8集群部署

时间:2017-04-20 21:11:59      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:waiting   poc   sig   ems   can   config   replicate   upd   diff   

 

tar zxvf 

make

make install 

mkdir redis-cluster

mkdir redis-cluser/6379、6380、81、82、83、84

cp redis.conf  redis-cluser/6379、6380、81、82、83、84

vim redis-cluser/6379、6380、81、82、83、84/redis.conf

port、pidfile、node-file

redis-server 6379、6380、81、82、83、84/redis.conf

 

yum install ruby ruby-devel rubygems rpm-build

gem install redis

# redis-trib.rb create --replicas 1 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382 127.0.0.1:6383 127.0.0.1:6384

>>> Creating cluster
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
127.0.0.1:6379
127.0.0.1:6380
127.0.0.1:6381
Adding replica 127.0.0.1:6382 to 127.0.0.1:6379
Adding replica 127.0.0.1:6383 to 127.0.0.1:6380
Adding replica 127.0.0.1:6384 to 127.0.0.1:6381
M: 46af51f0d193f3e76b322537bc11f9570ca13930 127.0.0.1:6379
   slots:0-5460 (5461 slots) master
M: 3caa86acc90199cd882475dc08622fdd522cf9a8 127.0.0.1:6380
   slots:5461-10922 (5462 slots) master
M: 01152da2da00e48384714c609241d2f83ca7bdc9 127.0.0.1:6381
   slots:10923-16383 (5461 slots) master
S: 825f0c904c8337d6eb8b5685e9b46fe36f7e9e99 127.0.0.1:6382
   replicates 46af51f0d193f3e76b322537bc11f9570ca13930
S: 0c01889b111948f334950e84aea677658d91f1bc 127.0.0.1:6383
   replicates 3caa86acc90199cd882475dc08622fdd522cf9a8
S: 567f1760b13de130a63396cc4e6983af5f6bca24 127.0.0.1:6384
   replicates 01152da2da00e48384714c609241d2f83ca7bdc9
Can I set the above configuration? (type yes to accept): 

yes:

>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join..
>>> Performing Cluster Check (using node 127.0.0.1:6379)
M: 46af51f0d193f3e76b322537bc11f9570ca13930 127.0.0.1:6379
   slots:0-5460 (5461 slots) master
   1 additional replica(s)
S: 0c01889b111948f334950e84aea677658d91f1bc 127.0.0.1:6383
   slots: (0 slots) slave
   replicates 3caa86acc90199cd882475dc08622fdd522cf9a8
S: 825f0c904c8337d6eb8b5685e9b46fe36f7e9e99 127.0.0.1:6382
   slots: (0 slots) slave
   replicates 46af51f0d193f3e76b322537bc11f9570ca13930
S: 567f1760b13de130a63396cc4e6983af5f6bca24 127.0.0.1:6384
   slots: (0 slots) slave
   replicates 01152da2da00e48384714c609241d2f83ca7bdc9
M: 3caa86acc90199cd882475dc08622fdd522cf9a8 127.0.0.1:6380
   slots:5461-10922 (5462 slots) master
   1 additional replica(s)
M: 01152da2da00e48384714c609241d2f83ca7bdc9 127.0.0.1:6381
   slots:10923-16383 (5461 slots) master
   1 additional replica(s)
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

 

 

 

 

 

Redis 3.2.8集群部署

标签:waiting   poc   sig   ems   can   config   replicate   upd   diff   

原文地址:http://www.cnblogs.com/ahaii/p/6740537.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!