redis error It was not possible to connect to the redis server(s); to create a disconnected multiple...

本文介绍了解决使用StackExchange.Redis库时遇到的连接异常问题。主要介绍了如何通过设置连接字符串中的abortConnect参数为false来实现自动重连。

应用redis出现如下错误

 It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING

参考stack overflow上文章 http://stackoverflow.com/questions/30895507/it-was-not-possible-to-connect-to-the-redis-servers-to-create-a-disconnected

是因为在StackExchange.Redis会默认 abortconnect=true,即当redis连接报错(如服务器上停止redis service等)时StackExchange会自动停止,即便后来redis服务端修好能够接通时,也不会自动连接。

所以需要在连接字符串里将值设置为false。若在webconfig中写成    <RedisCaching Enabled="false" ConnectionString="88.110.22.88,abortConnect=false" />

The error you are getting is usually a sign that you have not set abortConnect=false in your connection string. The default value for abortConnect is true, which makes it so thatStackExchange.Redis won't reconnect to the server automatically under some conditions. We strongly recommend that you set abortConnect=false in your connection string so that SE.Redis will auto-reconnect in the background if a network blip occurs.

转载于:https://www.cnblogs.com/taoshengyujiu/p/6348007.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值