Stackexchange.redis: Connecting to Redis Cluster: InternalFailure on PING

Created on 24 Oct 2016  路  8Comments  路  Source: StackExchange/StackExchange.Redis

Hello,
I'm trying to connect to a Redis Cluster (That works fine with other bindings like Python), and I get stuck at the connect step, here is my code :

using System;
using StackExchange.Redis;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Connecting to Redis cluster");
            var config = new ConfigurationOptions() {
                KeepAlive = 0,
                AllowAdmin = true,
                EndPoints = { { "127.0.0.1", 30000 }, { "127.0.0.1", 30001 }, {
                        "127.0.0.1", 30002 },{ "127.0.0.1", 30003 },{ "127.0.0.1", 30004
                    }, { "127.0.0.1", 30005 }}
            };
            var conn = ConnectionMultiplexer.Connect(config);

            Console.WriteLine("Selecting Database");
            var db = conn.GetDatabase();

            Console.WriteLine("Writring");
            for (int i = 0; i < 500; i++)
            {
                try
                {
                    db.StringSet("7001_00" + i, "00" + i);

                }
                catch (Exception ex)
                {
                    var str = ex.Message.ToString();
                    Console.WriteLine(str);
                }
         }
        }
    }
}

And here is what I get :

mathieu@gc-lab-linux-1 ~/redis-cluster-dotnet $ dotnet run
Project redis-cluster-dotnet (.NETCoreApp,Version=v1.0) was previously compiled. Skipping compilation.
Connecting to Redis cluster

Unhandled Exception: StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. InternalFailure on PING
   at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Func`1 multiplexerFactory, TextWriter log)
   at ConsoleApplication.Program.Main(String[] args)

I'm using version 1.1.608 on DotNet Core.

I've beeen searching for hours, tried with connection strings too but I get the same issue. The same cluster works fine with a Python client.

Any idea of what can be the issue ?

Thank you.
Mathieu

cluster

Most helpful comment

I seem to randomly get this with the latest library on core 2.1 "It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING" @NickCraver

All 8 comments

When disabling the ping, I then get messages like that :

Endpoint 127.0.0.1:30002 serving hashslot 5869 is not reachable at this point of time

Of course it is reachable without problem.

I tried with full .NET too and I get the same issue.

is this supposed to be supported now?
See #455 among others... did not think this was supported without a fork at this point.

I saw Support for redis "cluster" on the main page, maybe that means something else (another kind of clusters ?)

Hello.

Any news about the cluster support ?

Is there any support for the real Redis cluster (and not Sentinel) ?

I can see that there are code related to cluster specific instruction (like the MOVED response)

Thanks

@kedare check out @mgravell comment in: https://github.com/StackExchange/StackExchange.Redis/issues/670

@kedare @vtortola note: if this relates to redis 4.*, see #672 - this was due to an undocumented break in redis, and is fixed in the latest SE.Redis lib on nuget

No activity here since last reported - if anyone is still seeing this please ping me here and I'll reopen.

I seem to randomly get this with the latest library on core 2.1 "It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING" @NickCraver

Was this page helpful?
0 / 5 - 0 ratings