安装的整个过程参考:
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.gz
tar xvf redis-3.2.1.tar.gz
make && make install
2. ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz
tar xvf ruby-2.3.1.tar.gz
./configure
make && make install
3. gem --version
2.5.1
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 192.168.100.101:6381 192.168.100.101:6382 192.168.100.101:6383 192.168.100.101:6384 192.168.100.102:6381 192.168.100.102:6382 192.168.100.102:6383 192.168.100.102:6384
出现错误:
>>> Creating cluster
[ERR] Sorry, can't connect to node 192.168.100.101:6381
搜索到的解决方案一般为:
集群中不要设置密码 / redis.conf配置cluster-enabled yes / 服务器之间能PING/TELNET(除开防火墙原因)
/ redis.conf中配置bind 192.168.100.101 127.0.0.1, 再重启服务器 这一条为自创, Google百度本博客外搜不到的解决方案;
由于can't connect to node 192.168.100.101:6381, 就试着链接192.168.100.101:6381一下, 输入命令keys *测试, 发现有如下4点可能对解决问题有用, 红色部分是配置bind ip地址, 最简单常用(其他几条没有测试):
redis@redis-cache-1:~/redis-3.2.1/src$ ./redis-cli -h 192.168.100.101 -p 6381
10.160.16.221: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维护带来方便.
相关推荐
ubuntu12.04安装mysql---黑佳伦.pdf
ubuntu 12.04 安装mysql---黑佳伦.docx
在ubuntu12.04系统或者其之上的系统安装cmake-2.8.5;相关环境变量的设置,以及ubuntu下opencv的安装和交叉编译提供支持;
ubuntu-12.04-desktop-i386.iso
如果卸载了network-manager,就无法再上网进行 apt-get ...ubuntu 12中有线网无法设static ip,可先卸载network-manager,再修改eth0配置,重新安装network-manager,系统显示有线网络设备未托管,但是已经可以用了!
包括源码包及编译安装文档 已在ubuntu上安装成功
Ubuntu12.04的apt-get搜狐源,直接下载至/etc/apt/下即可,执行apt-get update
ubuntu镜像
libc6 for ubuntu 12.04 所有依赖的库都打包 .
pmLinux-Ubuntu_12.04-20.10_x86_arm 触屏驱动
电阻屏-penmount主控driver,liunx版Ubuntu_12.04-21.1
Redis源代码
Ubuntu12.04 nginx python uwsgi Django安装步骤
ubuntu12.04安装及配置过程详解
采用Ubuntu12.04下安装NS-2.34及实现802.11pWAVE协议栈,可实现车联网相关协议的开发和研究。
Ubuntu 12.04下如何安装MySQL ,我按照这文档,已经成功在ubuntu 12.04安装成功mysql!
ubuntu精简版操作系统
Ubuntu Server 12.04安装图解,附件中为安装过程中全部截图,可按照图中所选择部分安装
openssh6.7.deb download packed for debian7/ubuntu12.04 amd64-附件资源