imperugo / StackExchange.Redis.Extensions

MIT License
601 stars 179 forks source link

Sentinel not work #566

Open zhoudi94 opened 1 year ago

zhoudi94 commented 1 year ago

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):

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

zhoudi94 commented 1 year ago

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

image

imperugo commented 6 months ago

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