我正在使用 Stackexchange.Redis 并尝试连接到 Redis 集群并运行 HashGetAll()。但我遇到了一个异常(exception):
Endpoint 172.18.0.2:6379 serving hashslot 4038 is not reachable at this point of time. Please check connectTimeout value. If it is low, try increasing it to give the ConnectionMultiplexer a chance to recover from the network disconnect.
当我通过 redis-cli 使用我的集群时,我没有出现错误。 我正在使用 Windows 并在 Docker 中设置我的 redis 集群。
这是我连接到我的数据库的方式
var connectionMultiplexer = ConnectionMultiplexer.Connect(new ConfigurationOptions
{
ConnectTimeout = 99000,
EndPoints =
{
"127.0.0.1:6381",
"127.0.0.1:6382",
"127.0.0.1:6383",
"127.0.0.1:6384",
"127.0.0.1:6385",
"127.0.0.1:6386"
}
});
_database = connectionMultiplexer.GetDatabase();
最佳答案
我试图用 redis 重启 docker 但它没有帮助。 然后完全停止有问题的节点,让主节点更改为另一个节点并应用程序应用更改。几分钟后错误消失,我再次启动 redis,它又开始工作了。
关于c# - 端点 x.x.x.x :port serving hashslot nnnn is not reachable at this point of time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50016362/