c# - 端点 x.x.x.x :port serving hashslot nnnn is not reachable at this point of time

标签 c# redis stackexchange.redis

我正在使用 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/

相关文章:

c# - 应该如何在多线程应用程序中使用 StackExchange.Redis IDatabase 对象?

asp.net - Web场景下StackExchange.Redis ConnectionMultiplexer生命周期管理

c# - 如何根据 C# 中的标准随机化数字?

c# - IIS 托管 Web 核心托管 ASP.NET MVC

c# - 在 C# 中的类中添加否定运算符 (?)

node.js - 在 Heroku 上使用集群和 socket.io-redis 扩展 node.js socket.io@1.*.*

scala - 来自 Redis 客户端 Jedis 的破管道异常

redis - 我可以在 Redis 中使用一个订阅者模式订阅多个主机(和集群)吗?

c# - 为什么当文件变大时我的内存就会耗尽?

asp.net-core - 为什么DistributedCache SessionHandler抛出连接问题?