一、环境说明
1.Operation OS:CentOS7.2
2.ruby version >= 2.2.2
3.openssl zlib gcc>=4.8.5
二、开始部署
1.安装ruby
2.安装redis
3.创建集群
# 安装redis所需要的插件 [root@localhost ~]# gem install redis # 启动集群 [root@localhost ~]# cd /usr/local/redis/utils/create-cluster [root@localhost create-cluster]# ./create-cluster start Starting 30001 Starting 30002 Starting 30003 Starting 30004 Starting 30005 Starting 30006 # 创建集群配置文件 [root@localhost create-cluster]# ./create-cluster create >>> Creating cluster >>> Performing hash slots allocation on 6 nodes... Using 3 masters: 127.0.0.1:30001 127.0.0.1:30002 127.0.0.1:30003 Adding replica 127.0.0.1:30004 to 127.0.0.1:30001 Adding replica 127.0.0.1:30005 to 127.0.0.1:30002 Adding replica 127.0.0.1:30006 to 127.0.0.1:30003 M: d20bcd5662dd441a26ea3a5444fa2bb7b67007c4 127.0.0.1:30001 slots:0-5460 (5461 slots) master M: 8adc14dbdcb023d82f5ff298a03f2c8e9be742b9 127.0.0.1:30002 slots:5461-10922 (5462 slots) master M: a94b5cac60e0a6e05bc7431f6ea7103b85b25bac 127.0.0.1:30003 slots:10923-16383 (5461 slots) master S: 5c0fc767599ed20f97d146d6e589c1af1c6e42c2 127.0.0.1:30004 replicates d20bcd5662dd441a26ea3a5444fa2bb7b67007c4 S: ff3913fd1ec79dfb2b5bccd258fe7e136ed77458 127.0.0.1:30005 replicates 8adc14dbdcb023d82f5ff298a03f2c8e9be742b9 S: e0a0176c46403bf81e98d6d6d0b6842eebeb23fd 127.0.0.1:30006 replicates a94b5cac60e0a6e05bc7431f6ea7103b85b25bac Can I set the above configuration? (type 'yes' to accept): yes *** Aborting...
4.注意
1> ruby版本必须大于等于2.2.2,否则gem install redis会报错;
2> 必须安装openssl zlib插件,否则gem install redis也会报错,yum安装如下
原文链接:https://www.cnblogs.com/herui1991/p/12060121.html
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/16940