微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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 接口时报:
[root@server 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 :
[root@server 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 目录软链接到 / 目录下:
[root@server 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之前即可解决.

原文地址:https://www.jb51.cc/centos/381609.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。