希望屁会更有味道 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有没有侦听,是不是服务掉线了

    评论

报告相同问题?

悬赏问题

  • ¥15 C# P/Invoke的效率问题
  • ¥20 thinkphp适配人大金仓问题
  • ¥20 Oracle替换.dbf文件后无法连接,如何解决?(相关搜索:数据库|死循环)
  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号
  • ¥15 算法使用了tf-idf,用手肘图确定k值确定不了,第四轮廓系数又太小才有0.006088746097507285,如何解决?(相关搜索:数据处理)
  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理