天天看點

安裝redis3.2.4叢集時出現的一些坑

一.yum 安裝時錯誤 Errno 14 Couldn't resolve host 解決辦法

修改一下 /etc/resolv.conf添加一個nameserver 8.8.8.8完成

二.gem install redis時報錯

  1. yum install curl
  2. curl -L get.rvm.io | bash -s stable

三.安裝RVM失敗: public key not found

$ curl -L get.rvm.io | bash -s stable --ruby  
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current  
                                 Dload  Upload   Total   Spent    Left  Speed  
100   184  100   184    0     0     30      0  0:00:06  0:00:06 --:--:--    40  
100 22721  100 22721    0     0   1845      0  0:00:12  0:00:12 --:--:--  6170  
Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz  
Downloading https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc  
gpg: Signature made Tue 31 Mar 2015 05:52:13 CST using RSA key ID BF04FF17  
gpg: Can't check signature: public key not found  
Warning, RVM 1.26.0 introduces signed releases and automated check of signatures when GPG software
  
    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3      

解決方法是:

1.$  gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3  
2.gpg: requesting key D39DC0E3 from hkp server keys.gnupg.net  
3.gpg: /home/charles/.gnupg/trustdb.gpg: trustdb created  
4.gpg: key D39DC0E3: public key "Michal Papis (RVM signing) <[email protected]>" imported  
5.gpg: no ultimately trusted keys found  
6.gpg: Total number processed: 1  
7.gpg:               imported: 1  (RSA: 1)      

然後重新執行: curl -L get.rvm.io | bash -s stable --ruby

四.繼續第二步驟的後續操作:

3. source /usr/local/rvm/scripts/rvm

4.檢視rvm庫中已知的ruby版本

rvm list known

5.安裝一個ruby版本

rvm install 2.3.3

6.使用一個ruby版本

rvm use 2.3.3

7.解除安裝一個已知版本

rvm remove 2.0.0 

8.檢視版本

ruby --version

9.再安裝redis

gem install redis

五.配置檔案中修改的幾個地方:

port 7000

cluster-enabled yes

cluster-config-file nodes.conf

cluster-node-timeout 5000

appendonly yes

daemonize  yes

databases  1

protected-mode no

Sorry, can't connect to node 192.168.8.136:7001

配置檔案裡面設定bind為目前的ip位址, 将bind 127.0.0.1這行注釋掉

redis01/redis-cli -p 7002 -c

Could not connect to Redis at 127.0.0.1:7002: Connection refused

配置為bind 127.0.0.1 192.168.8.136這樣配置後遠端可以連接配接redis01/redis-cli 192.168.8.136 -p 7002 但是-c參數無效,報(error) ERR unknown command '-c'

配置錯誤的話jedis連接配接報錯:JedisClusterMaxRedirectionsException: Too many Cluster redirections?

繼續閱讀