center os 配置redis .net 连接遇到的坑

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 进行防火墙安装

centos 7 防火墙和端口配置

开启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





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值