Redis 3.2.8集群部署

Posted ahaii

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Redis 3.2.8集群部署相关的知识,希望对你有一定的参考价值。

 

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集群部署的主要内容,如果未能解决你的问题,请参考以下文章

redis3.2.8集群安装

redis-cluster分布式集群安装部署

redis集群配置

CentOS7 redis-3.2.8 从单机到主从再到集群配置

linux 的环境搭建(二)--redis单机环境、生产环境、集群环境的搭建

redis以及php的redis扩展安装部署