简体   繁体   English

无法在 .net C# 中连接 AWS Redis 缓存 - RedisConnectionException: '没有连接处于活动状态/可用于服务此操作

[英]Unable to connect AWS Redis cache in .net C# - RedisConnectionException: 'No connection is active/available to service this operation

I have created AWS ElasticCache - redisCache in console.我在控制台中创建了 AWS ElasticCache - redisCache。 I want to access same from .net core/framework application - But unable to connect same.我想从 .net core/framework 应用程序访问相同的内容 - 但无法连接相同的内容。

        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 - Gettitng 低于错误 -

StackExchange.Redis.RedisConnectionException: 'No connection is active/available to service this operation: SET mykey; StackExchange.Redis.RedisConnectionException:'没有连接处于活动状态/可用于服务此操作: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' UnableToConnect on xxxxx.cache.amazonaws.com:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, 未完成: 0, last-read: 5s ago, last-write: 5s ago, keep-alive: 60s,状态:正在连接,mgr:10 个中的 10 个可用,最后一次心跳:从不,全局:5 秒前,v:2.2.88.56325,mc:1/1/0,mgr:10 个中的 10 个可用,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'

In my case the issue was related with the DNS.就我而言,问题与 DNS 有关。 (I am using a VPN to access Redis). (我正在使用 VPN 访问 Redis)。 So what I did was put the google DNS in my wifi connection and that did the trick:所以我所做的就是将谷歌 DNS 放在我的 wifi 连接中,这样就成功了:

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么错误 No connection is available to service this operation: SETEX while write to Redis Cache in C# console application 以及如何解决它 - Why error No connection is available to service this operation: SETEX while writing to Redis Cache in C# console application and how to solve it 没有连接可用于服务此操作:使用 Azure Redis 缓存时 - No connection is available to service this operation: when using Azure Redis Cache 没有可用的连接服务此操作:ZRANGEBYSCORE redis - No connection is available to service this operation: ZRANGEBYSCORE redis 没有可用于服务此操作的连接 - Redis with StackExchange.Redis - No connection is available to service this operation - Redis with StackExchange.Redis 使用C#的AWS Elastic Cache Redis - AWS Elastic Cache Redis with C# StackExchange.Redis:没有连接可用于服务此操作:SET - StackExchange.Redis: No connection is available to service this operation: SET 如何将 aws redis 与 c# 连接 - how to connection aws redis with c# 我该如何解决这个错误 StackExchange.Redis.RedisConnectionException: UnableToConnect on redisaec.redis.cache.windows.net:6380/Interactive - how can I solve this error StackExchange.Redis.RedisConnectionException: UnableToConnect on redisaec.redis.cache.windows.net:6380/Interactive StackExchange.Redis:没有可用的连接来服务这个操作。 UnableToConnect on HOST:PORT/Interactive - StackExchange.Redis: No connection is available to service this operation. UnableToConnect on HOST:PORT/Interactive 如何连接到 C# 上的 AWS Quicksight 服务 - How to connect to AWS Quicksight service on C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM