StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.88k stars 1.51k forks source link

Unable to create ConnectionMultiplexer for Sentinel with redis SE #2594

Closed remus-corneliu closed 10 months ago

remus-corneliu commented 11 months ago

I'm trying to create a ConnectionMultiplexer using a redis configuration which I'm running locally in docker

Following are the implementation details

1 master - 2 replicas - 3 sentinels

try
 {
    var options = new ConfigurationOptions
    {
       CommandMap = CommandMap.Sentinel,
       EndPoints = { { "127.0.0.1", 6380 } },
       AllowAdmin = true,
       ServiceName = "redismaster",
       SyncTimeout = 5000,
       AbortOnConnectFail = false, // Allow connection retries
       Ssl = false
   };
   var conn = ConnectionMultiplexer.Connect(options, Console.Out);
}
catch (Exception ex)
{
}

redis.config file for my master instances

always-show-logo yes
set-proc-title no
proc-title-template "{title} {listen-addr} {server-mode}"

protected-mode no
bind 172.128.3.10
port 6370

masterauth pass
requirepass pass

loglevel verbose
logfile ""

databases 16

save 900 1
save 300 10
save 60 10000

rdbcompression yes

maxclients 100000

slowlog-log-slower-than 10000

redis.config file for standalone sentinels

always-show-logo yes

bind 172.128.3.13
port 6380
protected-mode no

sentinel announce-ip 172.128.3.13

sentinel myid 5bdaf984e15ec43bfde835d04d485848acbab78c
sentinel known-sentinel redismaster 172.128.3.14 6381 d8de0f4bcb59725cea695791379094ea12bfbde5
sentinel known-sentinel redismaster 172.128.3.15 6382 326f98bb6afca0ff9db88513ebcc0050033706f4

sentinel known-replica redismaster 172.128.3.11 6371
sentinel known-replica redismaster 172.128.3.12 6372

sentinel deny-scripts-reconfig yes
sentinel monitor redismaster 172.128.3.10 6370 2
sentinel auth-pass redismaster pass
sentinel down-after-milliseconds redismaster 5000
sentinel failover-timeout redismaster 60000

dir "/data"

sentinel resolve-hostnames no
sentinel announce-hostnames no

loglevel verbose
logfile ""

Getting

The message timed out in the backlog attempting to send because no connection became available - Last Connection Exception: It was not possible to connect to the redis server(s). ConnectTimeout, command=ROLE, timeout: 5000, inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, rs: NotStarted, ws: Idle, in: 0, last-in: 0, cur-in: 0, sync-ops: 1, async-ops: 0, serverEndpoint: 172.128.3.10:6370, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: DESK-123(SE.Redis-v2.6.104.40210), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=1,Free=32766,Min=36,Max=32767), POOL: (Threads=14,QueuedItems=0,CompletedItems=308), v: 2.6.104.40210 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

I don't understand where am I going wrong with this