Ubuntu12.04 安装 redis-3.2.1集群_Ruby_编程开发_程序员俱乐部

您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > Ubuntu12.04 安装 redis-3.2.1集群

Ubuntu12.04 安装 redis-3.2.1集群

 2016/7/16 5:33:37  greatwqs  程序员俱乐部  我要评论(0)
  • 摘要:安装的整个过程参考:http://www.cnblogs.com/gomysql/p/4395504.html一.环境信息1.redis-3.2.1:(http://redis.io/)http://download.redis.io/releases/redis-3.2.1.tar.gztarxvfredis-3.2.1.tar.gzmake&&makeinstall2.ruby2.3.1p112(2016-04-26revision54768)[x86_64
  • 标签:Ubuntu 安装




一. 环境信息

1. redis-3.2.1:


tar xvf?redis-3.2.1.tar.gz

make && make install


2.?ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]


tar xvf?ruby-2.3.1.tar.gz


make && make install


3.?gem --version



4.?gem install redis



1.?/usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- redis (LoadError)

from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'

from ./redis-trib.rb:25:in `<main>'

报此问题大多是环境信息有误, 请参照上面成功的环境信息, 如果低于上面的版本可以考虑升级;


2. ./redis-trib.rb create --replicas 1


>>> Creating cluster


[ERR] Sorry, can't connect to node?


集群中不要设置密码 / redis.conf配置cluster-enabled yes / 服务器之间能PING/TELNET(除开防火墙原因)

/ redis.conf中配置bind?, 再重启服务器 这一条为自创, Google百度本博客外搜不到的解决方案;


由于can't connect to node?, 就试着链接192.168.100.101:6381一下, 输入命令keys *测试, 发现有如下4点可能对解决问题有用, 红色部分是配置bind ip地址, 最简单常用(其他几条没有测试):

redis@redis-cache-1:~/redis-3.2.1/src$ ./redis-cli ?-h -p 6381> keys *

DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions:?

1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent.?

2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server.?

3) If you started the server manually just for testing, restart it with the '--protected-mode no' option.?


4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.


最后附件传上集群的配置mochabin.zip, 说明redis.conf中有配置dir /data/redis/cluster/6381/

/data是挂载的新硬盘, 专存储redis集群的日志, aof, dump数据, 为给后面线上redis维护带来方便.

  • mochabin.zip (26.6 KB)
  • 下载次数: 0
用户名: 匿名