Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Checking multiple conditions does not work

$
0
0

Hi,

I want to check 2 conditions on redis, where it should be master and on other checks, at least 2 of 3 sentinel nodes should provide this redis-instance being master.

Therefore, number of servers found on another backend check, is reused and if number if found server is at least 2, it should be selected.

However, condition with use-server and nbsrv is totally ignored. ge 2 is not working and lt 1 for example, not, too.
Any ideas?
Best
Ronny

backend check_master_redis1
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ master\ secucore-redis-001\r\n
tcp-check expect string 10.240.50.1
tcp-check send QUIT\r\n
tcp-check expect string +OK

server sentinel1 10.240.50.1:26379 check inter 2s
server sentinel2 10.240.50.2:26379 check inter 2s
server sentinel3 10.240.50.3:26379 check inter 2s

backend check_master_redis2
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ master\ secucore-redis-001\r\n
tcp-check expect string 10.240.50.2
tcp-check send QUIT\r\n
tcp-check expect string +OK

server sentinel1 10.240.50.1:26379 check inter 2s
server sentinel2 10.240.50.2:26379 check inter 2s
server sentinel3 10.240.50.3:26379 check inter 2s

backend check_master_redis3
mode tcp
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send SENTINEL\ master\ secucore-redis-001\r\n
tcp-check expect string 10.240.50.3
tcp-check send QUIT\r\n
tcp-check expect string +OK

server sentinel1 10.240.50.1:26379 check inter 2s
server sentinel2 10.240.50.2:26379 check inter 2s
server sentinel3 10.240.50.3:26379 check inter 2s

frontend ft_redis
bind *:6379
mode tcp
use_backend bk_redis

backend bk_redis
mode tcp

option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK

use-server redis1 if { srv_is_up(redis1) } { nbsrv(check_master_redis1) ge 2 }
use-server redis2 if { srv_is_up(redis2) } { nbsrv(check_master_redis2) ge 2 }
use-server redis3 if { srv_is_up(redis3) } { nbsrv(check_master_redis3) ge 2 }

server redis1 10.240.50.1:6379 check inter 1s
server redis2 10.240.50.2:6379 check inter 1s
server redis3 10.240.50.3:6379 check inter 1s

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>