1.Redis 的集群安装
http://blog.csdn.net/xu470438000/article/details/42971091
2. C#客户端使用ServiceStack.Redis 可参考
https://github.com/ServiceStack/ServiceStack.Redis
此时以为大功告成,没有想到一运行就出现,无法连接的问题
3.查找问题所在,防火墙和端口未进行配置
新装的看看/etc/sysconfig/ 下有没有iptables,看看service iptables start 能不能正常启动,如果不能启动则用root用户,yum -install iptables-services 进行防火墙安装
开启redis端口,修改防火墙配置文件 vi /etc/sysconfig/iptables
加入端口配置
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6379:7000 -j ACCEPT //开放6379到7000之间的端口
service iptables save
service iptables restart
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
4.万事大吉,以为这次可以连接成功了,没有想到还是出现问题
Redis Sentinel配置使用过程中的一个坑(DENIED Redis is running in protected mode)
有没有感觉疯了???
再查资料。。
由于此错误和redis server的protect-mode为yes的访问错误颇为相似,官方在redis.conf的注释说明中有protected-mode这一配置项,但sentinel.conf的注释中完全没有提到过该配置项,我很疑惑,但还是尝试在sentinel.conf中加入
protected-mode no
参考地址:http://blog.csdn.net/alaska_bibi/article/details/52594639