【发布时间】:2014-06-03 07:34:47
【问题描述】:
我正在使用StackExchange.Redis 与 3 个不同的 Redis 实例通信:1 个在同一子网上,2 个远程。这是我的配置代码:
var configurationOptions = new ConfigurationOptions
{
EndPoints =
{
{ host, port }
},
KeepAlive = 180,
Password = password,
DefaultVersion = new Version("2.8.5"),
// Needed for cache clear
AllowAdmin = true
};
var connectionMultiplexer = ConnectionMultiplexer.Connect(configurationOptions );
最后一行大约 70% 的时间会引发连接异常:
无法连接到 redis 服务器;要创建断开连接的多路复用器,请禁用 AbortOnConnectFail
为什么这是间歇性的和/或我做错了什么?当我在命令提示符下 ping Redis 服务器时,丢包率为 0%,响应时间小于 1 毫秒。网络稳定。
谢谢!
编辑
以下是失败时的日志输出:
10.48.68.28:6379,keepAlive=180,version=2.8.5
1 unique nodes specified
Requesting tie-break from 10.48.68.28:6379 > __Booksleeve_TieBreak...
Allowing endpoints 00:00:01 to respond...
10.48.68.28:6379 did not respond
10.48.68.28:6379 failed to nominate (WaitingForActivation)
No masters detected
10.48.68.28:6379: Standalone v2.8.5, master; keep-alive: 00:03:00; int: Connecting; sub: ConnectedEstablished, 1 active; not in use: DidNotRespond
10.48.68.28:6379: int ops=0, qu=4, qs=0, qc=0, wr=0, socks=1; sub ops=2, qu=0, qs=0, qc=0, wr=0, subs=1, sync=2, socks=1
Circular op-count snapshot; int: 0 (0.00 ops/s; spans 10s); sub: 0+2=2 (0.20 ops/s; spans 10s)
Sync timeouts: 0; fire and forget: 0; last heartbeat: -1s ago
Starting heartbeat...
【问题讨论】:
-
如果你传入一个 TextWriter 作为日志参数(StringWriter 工作正常) - 它说明了什么?
-
LSO:这在第一次启动时是否正确?第一次?我想知道 JIT / Fusion / DNS / etc 是多少
-
在启动时,第一次。当我将同步超时扩展到 30000 毫秒时,它没有帮助。总是等待最大值并失败。现在尝试
BookSleeve看看它是否有效。 -
qu=4 对我来说非常很有趣 - 它表明作者没有开始。你能告诉我你使用的是什么版本吗?基本上 qu 是未发送队列:有 4 条消息由于某种原因尚未发送。这让我很困扰。
-
它正在连接而不是建立连接这一事实也很有趣
标签: c# redis booksleeve stackexchange.redis