Created
December 2, 2024 17:43
-
-
Save dot-mike/3dec5d3440c0ca8203670475a80ca700 to your computer and use it in GitHub Desktop.
haproxy true master for redis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frontend redis-read | |
bind *:6379 | |
default_backend redis-online | |
frontend redis-write | |
bind *:6380 | |
default_backend redis-primary | |
backend redis-primary | |
mode tcp | |
balance first | |
option tcp-check | |
tcp-check send info\ replication\r\n | |
tcp-check expect string role:master | |
server redis-01:10.3.61.117:6379 192.168.1.11:6379 maxconn 1024 check inter 1s | |
server redis-02:10.4.61.116:6379 192.168.1.12:6379 maxconn 1024 check inter 1s | |
backend redis-online | |
mode tcp | |
balance roundrobin | |
option tcp-check | |
tcp-check send PING\r\n | |
tcp-check expect string +PONG | |
server redis-01:10.3.61.117:6379 192.168.1.11:6379 maxconn 1024 check inter 1s | |
server redis-02:10.4.61.116:6379 192.168.1.12:6379 maxconn 1024 check inter 1s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment