StackExchange.Redis集群 80C

StackExchange.Redis连接redis集群
报错:其他信息: Endpoint 127.0.0.1:7002 serving hashslot 15224 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 di
sconnect.

代码:
public static ConnectionMultiplexer Instance
{
get
{
if (_instance == null)
{
lock (Locker)
{
if (_instance == null || !_instance.IsConnected)
{
_instance = GetManager();
}
}
}
return _instance;
}
}

    public static ConnectionMultiplexer GetConnectionMultiplexer(string connectionString)
    {
        if (!ConnectionCache.ContainsKey(connectionString))
        {
            ConnectionCache[connectionString] = GetManager(connectionString);
        }
        return ConnectionCache[connectionString];
    }

public bool StringSet(string key, string value, TimeSpan? expiry = default(TimeSpan?))
{
key = AddSysCustomKey(key);

        var profiler = new RedisProfiler();

        _conn.RegisterProfiler(profiler);
        _conn.BeginProfiling(profiler.MyContext);
        var db = _conn.GetDatabase();
        db.StringSet(key, value, expiry);
        db.StringSet("hello", "world");

        var msgs = _conn.FinishProfiling(profiler.MyContext);

        return true;
    }

1个回答

127.0.0.1:7002 serving hashslot 15224 is not reachable

z这个端口的redis有没有侦听,是不是服务掉线了

sunbingi110
希望屁会更有味道 连接单机redis可以但是集群就开始报错
大约 3 年之前 回复
sunbingi110
希望屁会更有味道 redis集群正常
大约 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问