1

I'am trying to implement Redis cache service by StackExchange.Redis library.

My Redis client:

public class RedisClient
    {
        private static Lazy<ConnectionMultiplexer> lazyConnection = new Lazy<ConnectionMultiplexer>(() =>
        {
            return ConnectionMultiplexer.Connect(string.Format("{0},{1}",
                        ConfigurationManager.AppSettings.GetStringOrDefault("redis_masters", "someIP1:6379"),
                        ConfigurationManager.AppSettings.GetStringOrDefault("redis_slaves", "someIP2:6379")));
        });

        public static ConnectionMultiplexer GetConnection
        {
            get
            {
                return lazyConnection.Value;
            }
        }
    }

And i try to get connection in this way:

using (var redis = RedisClient.GetConnection)
{
    ...
}

I get exception: "It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING"

I also tried to add some configuration to connection like this:

ConnectionMultiplexer.Connect(string.Format("{0},{1},Ssl=false"

And i get another exception: "ValueFactory attempted to access the Value property of this instance."

My connection to Redis worked fine with enother library : "StackExchange.Redis" I just try to migrate is to "ServiceStack.Redis" What i missing?

1 Answer 1

1

Use password in configuration

ConnectionMultiplexer.Connect("localhost,password=XXXXX");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.