redis集群配置安装的过程常见问题![ERR] Sorry, can't connect to node cdh5:6379

2016-12-13 19:29:48来源:CSDN作者:wumiqing1人点击

第七城市
 1) ./redis-trib.rb  create --replicas 1 cdh5:6379 cdh4:6379 cdh3:6379 cdh5:6389 cdh4:6389 cdh3:6389
 报错:
 >>> Creating cluster

Connecting to node cdh5:6379: [ERR] Sorry, can't connect to node cdh5:6379

可能的问题:

第一: ruby 和rubygem 版本太低,安装新版本。

    安装 ruby 和rubygem

        ftp://ftp.ruby-lang.org/pub/ruby/ 下载ruby-2.3.1.tar.gz ,上传到cdh5服务器目录:/usr/local/src目录

      cd   /usr/local/src  

      tar -zxvf  ruby-2.3.1.tar.gz 

     cd  ruby-2.3.1

   ./configure && make && make install

   安装gem-redis:ruby和redis的接口:

下载 redis-3.0.0.gem  执行:

gem install -l redis-3.0.0.gem

报错:

ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

解决方法:http://www.openssl.org/source/下载:openssl-1.0.1u.tar.gz 注意:一定要下载1.0.1版本 其他版本怎么试都不行!!!!

tar -xzvf openssl-1.0.1u.tar.gz

cd openssl-1.0.1u

./config -fPIC --prefix=/usr/local/openssl enable-shared

./config -t

make && make install 

进入ruby源码[/usr/local/src/ruby-2.3.0]目录下的ext/openssl 目录:

ruby extconf.rb --with-openssl-include=/usr/local/openssl/include/ --with-openssl-lib=/usr/local/openssl/lib

显示如下说明正确:[root@localhost openssl]# make  
     compiling ossl_pkey_dsa.c  
     compiling openssl_missing.c  
     compiling ossl_x509name.c  
     compiling ossl_pkey_rsa.c  
      .............................................中间略.............................................  
     compiling ossl_bn.c  
     compiling ossl.c  
     linking shared-object openssl.so   

make  && make install

再次执行:gem install -l redis-3.0.0.gem


配置环境变量:

export OPENSSL=/usr/local/openssl/bin

export PATH=$OPENSSL:$PATH:$HOME/bin

如果查看版本报错:ruby -v  、 gem -v

openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

则执行:ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1


如果发现报错:cannot load such file -- zlib ruby  ------可以参考本人另外一篇文章:

http://blog.csdn.net/wumiqing1/article/details/53606557


-------------到此:ruby rubygem  gem-redis已经安装完毕-------


cd /usr/local/src/redis-3.0.1/src/
./redis-trib.rb  create --replicas 1 10.222.128.30:6379 10.222.128.29:6379 10.222.128.28:6379 
                                     10.222.128.30:6389 10.222.128.29:6389 10.222.128.28:6389


一定要注意些ip,不能写hostname 要不然不支持!用户也要切换正确,本人用户 su - redis_6379!!!!

如果还是报错:Creating cluster Connecting to node ****:6379: [ERR] Sorry, can't connect to node ****:6379

解决方法:检查redis配置:

vi  redis.conf

 cluster-enabled yes

 cluster-config-file nodes-6379.conf

 cluster-node-timeout 5000

确保这些不被注释:

并清除: cluster-config-file 对应的配置文件!重启redis

再次执行:./redis-trib.rb  create --replicas 1 10.222.128.30:6379 10.222.128.29:6379 10.222.128.28:6379 
                                     10.222.128.30:6389 10.222.128.29:6389 10.222.128.28:6389
 






       


第七城市

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台