希望屁会更有味道 2017-07-19 00:47 采纳率: 0%
浏览 2448
已结题

StackExchange.Redis集群

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条回答 默认 最新

  • oyljerry 2017-07-19 01:28
    关注

    127.0.0.1:7002 serving hashslot 15224 is not reachable

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

    评论

报告相同问题?

悬赏问题

  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题