0

I have created AWS ElasticCache - redisCache in console. I want to access same from .net core/framework application - But unable to connect same.

        ConfigurationOptions option = new ConfigurationOptions
        {
           AbortOnConnectFail = false,
           Ssl = true,
           ConnectTimeout =5000,
           KeepAlive = 2,
           EndPoints = { "xxxxxxxxxx.cache.amazonaws.com:6379" }
        };

        ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(option);
        IDatabase db = redis.GetDatabase();
        string value = "abcdefg";
        db.StringSet("mykey", value);
        string getValue = db.StringGet("mykey");
        return getValue;

Gettitng below error -

StackExchange.Redis.RedisConnectionException: 'No connection is active/available to service this operation: SET mykey; UnableToConnect on xxxxx.cache.amazonaws.com:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 5s ago, last-write: 5s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 5s ago, v: 2.2.88.56325, mc: 1/1/0, mgr: 10 of 10 available, clientName: machineId, IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=1,Free=32766,Min=8,Max=32767), v: 2.2.88.56325'

1
  • Weird.. I am getting this today too. But with Azure's Redis... but I think mine is because I am trying to get at it from a container in AKS Commented Feb 26, 2022 at 10:59

1 Answer 1

1

In my case the issue was related with the DNS. (I am using a VPN to access Redis). So what I did was put the google DNS in my wifi connection and that did the trick:

enter image description here

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.