StackExchange.Redis.Extensions icon indicating copy to clipboard operation
StackExchange.Redis.Extensions copied to clipboard

Sentinel not work

Open deidei1216 opened this issue 2 years ago • 3 comments

Describe the bug Before to open an issue, please be sure that it is not related to StackExchange.Redis but to this libray that is a simple wrapper. After that, please add a clear and concise description of what the bug is.

This operation has been disabled in the command-map and cannot be used: GET

image

To Reproduce Steps to reproduce the behavior:

my code image image

Expected behavior A clear and concise description of what you expected to happen.

I try this and it works fine image

Screenshots / StackTrace If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Linux Alpine]
  • Runtime version [.NET Framework, .NET Core 3.0 ....]
  • Version [e.g. 6.0.0]

StackExchange.Redis.Extensions.AspNetCore v9.1.0 Additional context Add any other context about the problem here.

deidei1216 avatar Jun 14 '23 04:06 deidei1216

I solved this problem by setting the ConnectionString field, why?

image

deidei1216 avatar Jun 14 '23 05:06 deidei1216

Hi, sorry for the delay.

Your code looks good, If I check the RedisConfiguration of StackExchange.Redis.Extensions is enough to put the sentinel name into the ServiceName propreerty in order to use it


public bool IsSentinelCluster => !string.IsNullOrEmpty(ServiceName);

if (IsSentinelCluster)
{
     newOptions.ServiceName = ServiceName;
     newOptions.CommandMap = CommandMap.Sentinel;
}

I neeed to understand how to setup a sentinel service in my local environment and debug it, or better, write a unit test that replicate the issue

imperugo avatar Dec 23 '23 13:12 imperugo

Hi there, I have exactly the same issue. I would like to keep using the StackExchange.Redis.Extensions library to connect to our Redis setup. It was working perfectly fine by connecting directly to a Redis instance. Now I'd like to use also Redis Sentinel and I have also recognized the source code mentioned by @imperugo and I get the same error as @zhoudi94. Was there any solution until now or is there any example available how to use Redis Sentinel? Thanks in advance!

sprudel79 avatar Aug 09 '24 14:08 sprudel79