連接Redis 錯誤的解決方法: It was not possible to connect to the redis server(s); to create a disconnected multiplexer


 

The error you are getting is usually a sign that you have not set abortConnect=false in your connection string. The default value for abortConnect is true, which makes it so that StackExchange.Redis won't reconnect to the server automatically under some conditions. We strongly recommend that you set abortConnect=false in your connection string so that SE.Redis will auto-reconnect in the background if a network blip occurs.

 

Netcore :

pack: Microsoft.AspNetCore.DataProtection.StackExchangeRedis

using StackExchange.Redis;

 

public static void Main(string[] args)
{//Reids
var redis = ConnectionMultiplexer.Connect("localhost,abortConnect=false"); // or "localhost,abortConnect=false,connectTimeout=30000,responseTimeout=30000"
var s= redis.GetStatus();
CreateHostBuilder(args).Build().Run();
}

  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM