redis 集群准备
1 | # 拷贝环境,如果存在 dump.rdb,记得rm |
下载并配资后 ruby 搭建 redis 集群所依赖的包
https://rubygems.global.ssl.fastly.net/gems/redis-4.0.1.gem1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21sftp> put /Users/niuhesm/Downloads/redis-4.0.1.gem /root
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum install ruby
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# gem install redis-4.0.1.gem
ERROR: Error installing redis-4.0.1.gem:
redis requires Ruby version >= 2.2.2.
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]#
# 由于不想更新 yum 源,换个方式更新 ruby 版本
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum remove ruby
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# wget https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# tar zxvf ruby-2.2.3.tar.gz
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# cd ruby-2.2.3
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# ./configure
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# make
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# sudo make install
[root@iZuf6iq8e7ya9v3ix71k0pZ ruby-2.2.3]# ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
# 重新安装依赖包
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# gem install redis-4.0.1.gem
ruby 脚本搭建集群
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ redis-cluster]# cd /usr/local/redis/redis-4.0.8/src/ |
相关错误
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ redis-cluster]# ./redis-trib.rb create --replicas 1 106.15.191.27:7001 106.15.191.27:7002 106.15.191.27:7003 106.15.191.27:7004 106.15.191.27:7005 106.15.191.27:7006 |
1 | [root@iZuf6iq8e7ya9v3ix71k0pZ redis-cluster]# ./redis-trib.rb create --replicas 1 106.15.191.27:7001 106.15.191.27:7002 106.15.191.27:7003 106.15.191.27:7004 106.15.191.27:7005 106.15.191.27:7006 |
解决:删除相关的 dump.rdb,nodes-700x.conf