azure - 在 Azure 上托管的 .net Core 应用程序上连接到 Redis 时出错

标签 azure caching redis asp.net-core stackexchange.redis

我们在 Azure 上托管了一个 redis 缓存,我们在 .net 核心应用程序中使用以下内容作为服务:

services.AddSingleton<IConnectionMultiplexer>(provider => 
    ConnectionMultiplexer.Connect(Configuration.GetConnectionString("RedisConnection"))
);

我们的连接字符串类似于以下内容:

ourserver.redis.cache.windows.net:6380,password=******=,ssl=True,abortConnect=False,syncTimeout=4000

从缓存中获取我们不会遇到问题,但是如果我们添加到缓存中,我们有时会遇到以下错误:

"StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. ConnectTimeout"

我已经阅读了将 abortconnect 设置为 false 并增加超时的解决方案,但我已经像上面的连接字符串一样实现了它。

如果您有任何建议或者您认为我们的连接字符串有问题,请提出建议。

更新:我们已经实现了解决连接问题的解决方案,但现在我们得到了这个:

StackExchange.Redis.RedisConnectionException: No connection is available to service this operation

最佳答案

您的 connectTimeout 设置为多少?您可以尝试增加它看看是否有帮助吗?

关于azure - 在 Azure 上托管的 .net Core 应用程序上连接到 Redis 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44250640/

相关文章:

azure - 如何按计划打开和关闭 Azure 网站?

Android WebView 在缓存路径中下载图片

c# - 使用 C# asp.net/Net 4.7 为 HA 缓存大对象

Redis 缓存跨区域共享

android - 找不到 Azure 通知中心的“调试”选项卡(新 UI)

c# - ASP.NET WebApi 无法与 Azure 中的 COM (Excel) 配合使用

c++ - 在运行时添加字段 : suffer either vtable-cost or cache miss at destructor

heroku - almot 没有键的 Redis 高内存使用率

使用 ServiceBus 队列触发器在消耗计划中运行时,Azure 函数会空闲

caching - expires、max-age 和 shared max-age 之间有什么区别?