简体   繁体   English

StackExchange.Redis StringGetAsync 返回空值

[英]StackExchange.Redis StringGetAsync returns null value

Setup设置

Using 2 Redis Servers on Linux in Production在 Linux 生产环境中使用 2 个 Redis 服务器

Using Sentinel for High Availability使用 Sentinel 实现高可用性

StackExchange.Redis Nuget Package version is 1.2.6 StackExchange.Redis Nuget 包版本为 1.2.6

.NET 4.5 Windows Service consumes the Redis Cache. .NET 4.5 Windows 服务使用 Redis 缓存。

The windows service is under load balancer. Windows 服务在负载均衡器下。

Application Flow申请流程

Step 1第1步

The first request has an approval request going from the client to an endpoint.第一个请求有一个从客户端到端点的批准请求。 Unique Transaction ID is generated and stored (expiry is 60 mins) in the Redis Cache for the next amend request生成唯一的交易ID(过期时间为60分钟)在Redis Cache中,以备下一次修改请求

Step 2 Amend request is sent by the client within minutes of approval request.步骤 2 客户在批准请求的几分钟内发送修改请求。 The transaction id stored in the previous step needs to be retrieved from the Redis Service and attach to amend request to be sent to endpoint.需要从 Redis 服务中检索上一步中存储的事务 ID,并附加到要发送到端点的修改请求。

The issue we are facing is that during the amend request the unique transaction id retrieval fails and returns null value.我们面临的问题是,在修改请求期间,唯一交易 id 检索失败并返回空值。 We are using the StringGetAsync method to get the value from the Redis Cache.我们使用 StringGetAsync 方法从 Redis 缓存中获取值。 It works most of the times and some of them fail.它在大多数情况下都有效,但其中一些失败了。

The two steps can be executed on any of the servers in the farm.这两个步骤可以在场中的任何服务器上执行。 We have logs to verify that the Setting the value in Redis Service returns true.我们有日志来验证在 Redis 服务中设置值是否返回 true。

Redis logs information is limited to sync operations. Redis 日志信息仅限于同步操作。

Need help on how to troubleshoot/solve this issue.需要有关如何排除故障/解决此问题的帮助。

Thanks for the response.感谢您的回复。 Upon further investigation found that the Sentinel Service was in stopped State in all the Redis Servers.进一步调查发现,所有Redis服务器中的哨兵服务都处于停止状态。 Starting the Sentinel Service solved the issue.启动 Sentinel 服务解决了这个问题。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM