1. 前期准备 安装ruby 升级ruby参见前一篇

前期准备

# EPEL源安装ruby支持

yum install ruby rubygems -y

使用国内源

gem source -a http://mirrors.aliyun.com/rubygems/  -remove https://rubygems.org/
# gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
# 安装redis支持
gem install redis -v 3.3.3
gem sources -l

 

 

2. 创建目录,创建配置文件。

[root@localhost]# mkdir /opt/redis-cluster
 [root@localhost]# cd /opt/redis-cluster
 [root@localhost redis-cluster]# mkdir 7001 7002 7003 7004 7005 7006

3. 启动redis-server 

 

./redis-trib.rb create --replicas 1 10.129.7.5:6377 10.129.7.5:6378 10.129.5.1:6377 10.129.5.1:6378 10.129.7.4:6377 10.129.7.4:6378

 

redis-trib.rb是官方提供的Redis Cluster的管理工具,无需额外下载,默认位于源码包的src目录下,但因该工具是用ruby开发的,所以需要准备相关的依赖环境。

[root@ht23 redis-4.0.14]# cp -a src/redis-trib.rb ./
[root@ht23 redis-4.0.14]# ls
00-RELEASENOTES  CONTRIBUTING  deps     Makefile   README.md   redis-trib.rb  runtest-cluster   sentinel.conf  tests
BUGS             COPYING       INSTALL  MANIFESTO  redis.conf  runtest        runtest-sentinel  src            utils
[root@ht23 redis-4.0.14]# pwd
/usr/local/redis-4.0.14

所有的悲情叙事,都是因为你的基础体能不够