1. 程式人生 > >Centos6.4搭建Redis叢集遇到的幾個問題彙總

Centos6.4搭建Redis叢集遇到的幾個問題彙總

其實Redis叢集的搭建是比較簡單的,比oracle,mysql,mongodb都簡單.但是其中還是有很多坑.我搞了兩天才把所有的坑填完,下面是遇到的幾個錯誤,尤其是最後一個坑.搞了很久才解決:

1.ruby的版本過低,直接刪除原來的ruby版本,下載最新的ruby重新編譯安裝. 2.#gem install redis的報錯: ERROR:  Loading command: install (LoadError)     no such file to load -- zlib ERROR:  While executing gem ... (NameError)     uninitialized constant Gem::Commands::InstallCommand 解決辦法是: 進入ruby原始碼資料夾  安裝ruby自身提供的zlib包  #cd ext/zlib #ruby ./extconf.rb #make #make install 3
.配置群集,使用gem install 安裝 ruby redis 介面時報: [[email protected] zlib]# gem install redis ERROR:  While executing gem ... (Gem::Exception)     Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources 解決方法:  yum -y install openssl-devel  yum -y install openssl 進入ruby 原始碼目錄下的ext/openssl 目錄:  cd /usr/local/src/ruby-2.2.3/ext/openssl/ 執行 ruby ./extconf.rb : [
[email protected]
openssl]# ruby extconf.rb  checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for assert.h... yes checking for openssl/ssl.h... yes ..........................................................................中間略.......................................................................... checking for EVP_CTRL_GCM_GET_TAG in openssl/evp.h... yes creating extconf.h creating Makefile 將ruby 原始碼目錄下的include 目錄軟連結到 / 目錄下: [
[email protected]
openssl]# ln -s /usr/local/src/ruby-2.2.3/include / 再編譯安裝: make && make install 然後就好了! 再執行: gem install redis 即可正常執行!! 4.在使用redis-trib.rb create --replicas 1  xxx來建立叢集,在執行到下面的時候一直等待 >>> 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................................. 這裡一直等待join. 原因是在配置檔案中的引數bind 寫的有問題, 原來是bind 127.0.0.1 192.168.56.91 後來修改為bind 192.168.56.91 127.0.0.1 即將實際IP寫在迴環ip之前即可解決.