无法连接到 Azure Redis 缓存
Not able to connect with Azure Redis cache
我完全受够了带功能的 Azure Redis 缓存。
下面的行 "Test Code" 在控制台应用程序中工作但不使用 Azure Functions。
IConnectionMultiplexer connection = ConnectionMultiplexer.Connect("**********rediscache.redis.cache.windows.net:6380,password=nFpm1oIiyP8ZiCxC/WMcxaFRzGo4yMgWDYZksQgqO4U=,ssl=True,abortConnect=False");
IDatabase database = connection.GetDatabase();
bool isConnected = connection.IsConnected;
var test = database.HashExists("key", "fieldKey");
database.HashSet("key", "fieldKey", "test");
database.StringSet("Key", "Value");
var result = database.StringGet("Key");
connection.Close();
使用 Visual Studio
中的 Azure 函数
Nuget - StackExchange.Redis 2.0.505 & Microsoft.NET.Sdk.Functions 1.0.22
Exception while executing function: Function1. StackExchange.Redis:
No connection is available to service this operation: HEXISTS key;
UnableToConnect on
catamsrediscache.redis.cache.windows.net:6380/Interactive,
Flushed, last: ECHO, origin: ResetNonConnected, outstanding: 9, last-read:
5s ago, last-write: 0s ago, unanswered-write: 0s ago, keep-alive: 60s,
state: ConnectedEstablishing, mgr: 10 of 10 available, last-heartbeat:
never, global:
0s ago, v: 2.0.505.18761; IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER:
(Busy=2,Free=1021,Min=4,Max=1023), Local-CPU: n/a. UnableToConnect on
catamsrediscache.redis.cache.windows.net:6380/Interactive, Flushed, last:
ECHO, origin: ResetNonConnected, outstanding: 9, last-read: 5s ago,
last-write: 0s ago, unanswered-write: 0s ago, keep-alive: 60s, state:
ConnectedEstablishing, mgr: 10 of 10 available, last-heartbeat: never,
global: 0s ago, v: 2.0.505.18761.
有人知道为什么这个错误只出现在函数中吗?
这看起来与 StackExchange.Redis GitHub 页面上的 this reported issue 几乎相同。我建议您在那里跟进您的错误详细信息,以帮助他们诊断您遇到的问题。
我遇到了同样的错误,必须将 StackExchange.Redis
Nuget 包更新到 1.2.6。
现在问题已通过 StackExchange.Redis 2.0.519
解决
我完全受够了带功能的 Azure Redis 缓存。
下面的行 "Test Code" 在控制台应用程序中工作但不使用 Azure Functions。
IConnectionMultiplexer connection = ConnectionMultiplexer.Connect("**********rediscache.redis.cache.windows.net:6380,password=nFpm1oIiyP8ZiCxC/WMcxaFRzGo4yMgWDYZksQgqO4U=,ssl=True,abortConnect=False");
IDatabase database = connection.GetDatabase();
bool isConnected = connection.IsConnected;
var test = database.HashExists("key", "fieldKey");
database.HashSet("key", "fieldKey", "test");
database.StringSet("Key", "Value");
var result = database.StringGet("Key");
connection.Close();
使用 Visual Studio
中的 Azure 函数Nuget - StackExchange.Redis 2.0.505 & Microsoft.NET.Sdk.Functions 1.0.22
Exception while executing function: Function1. StackExchange.Redis:
No connection is available to service this operation: HEXISTS key;
UnableToConnect on
catamsrediscache.redis.cache.windows.net:6380/Interactive,
Flushed, last: ECHO, origin: ResetNonConnected, outstanding: 9, last-read:
5s ago, last-write: 0s ago, unanswered-write: 0s ago, keep-alive: 60s,
state: ConnectedEstablishing, mgr: 10 of 10 available, last-heartbeat:
never, global:
0s ago, v: 2.0.505.18761; IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER:
(Busy=2,Free=1021,Min=4,Max=1023), Local-CPU: n/a. UnableToConnect on
catamsrediscache.redis.cache.windows.net:6380/Interactive, Flushed, last:
ECHO, origin: ResetNonConnected, outstanding: 9, last-read: 5s ago,
last-write: 0s ago, unanswered-write: 0s ago, keep-alive: 60s, state:
ConnectedEstablishing, mgr: 10 of 10 available, last-heartbeat: never,
global: 0s ago, v: 2.0.505.18761.
有人知道为什么这个错误只出现在函数中吗?
这看起来与 StackExchange.Redis GitHub 页面上的 this reported issue 几乎相同。我建议您在那里跟进您的错误详细信息,以帮助他们诊断您遇到的问题。
我遇到了同样的错误,必须将 StackExchange.Redis
Nuget 包更新到 1.2.6。
现在问题已通过 StackExchange.Redis 2.0.519
解决