[英]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
[英]Unable to connect AWS Redis cache in .net C# - RedisConnectionException: 'No connection is active/available to service this operation
我在控制台中創建了 AWS ElasticCache - redisCache。 我想從 .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 低於錯誤 -
StackExchange.Redis.RedisConnectionException:'沒有連接處於活動狀態/可用於服務此操作:SET mykey; 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'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.