【问题标题】:ASP.net app connection REDIS SocketFailure on PingASP.net 应用程序连接 REDIS SocketFailure on Ping
【发布时间】:2017-07-22 02:41:42
【问题描述】:

我刚刚在我的一个开发服务器中安装了 REDIS 服务器。我正在尝试将我的本地主机应用程序与这个外部服务器连接起来。我正在使用 StackExchange.REDIS api 连接到位于我的内部开发服务器 10.26.130.170 的这个 REDIS 服务器。我安装了所有默认的 REDIS 软件,到目前为止没有进行任何自定义。

这是我项目中的连接类::

  public sealed class RedisSingleton
{
    private static Lazy<ConfigurationOptions> configOptions = new Lazy<ConfigurationOptions>(() =>
                 {
                     var configOptions = new ConfigurationOptions();   
                     configOptions.EndPoints.Add("10.26.130.170:6379");
                     configOptions.ClientName = "MyAppRedisConn";
                     configOptions.ConnectTimeout = 100000;
                     configOptions.SyncTimeout = 100000;
                     configOptions.AbortOnConnectFail = true;                         
                     return configOptions;
                 });

    private static Lazy<ConnectionMultiplexer> LazyRedisconn = new Lazy<ConnectionMultiplexer>(
                                                                                                    () => ConnectionMultiplexer.Connect(configOptions.Value));

    public static ConnectionMultiplexer ActiveRedisInstance
    {
        get
        {
            return LazyRedisconn.Value;
        }
    }
}

请提供一些建议。有没有一种方法可以让我快速检查我的本地主机,并使用 ping 或其他命令验证端口 6379 与 REDIS 服务器的连接。

redis的远程服务器上没有打开6379端口。我在 windows PortQueryUI 工具的帮助下找到了它。

【问题讨论】:

    标签: asp.net redis stackexchange.redis


    【解决方案1】:

    我通过在远程服务器上打开端口找到了解决方案。

    https://stackoverflow.com/a/40164691/86023

    【讨论】:

      猜你喜欢
      • 2015-05-16
      • 2020-01-02
      • 2020-09-30
      • 2018-10-21
      • 2019-12-23
      • 1970-01-01
      • 2017-11-01
      • 2021-05-03
      • 2019-02-08
      相关资源
      最近更新 更多