0

I have two MariaDB servers, db1 and db2, and a HAProxy. The HAProxy should load balance between them two and take one off if slave lag is too large. The setup is mostly taken from here:

https://severalnines.com/resources/tutorials/mysql-load-balancing-haproxy-tutorial

with a couple of improvements. So, an agent checks the slave lag, and the regular check should take off the nodes from the cluster (in fact, it is a two-node multi master replication).

I have HAProxy version 1.5.8 and am looking since days here:

https://cbonte.github.io/haproxy-dconv/1.5/configuration.html

for a possibility that HAProxy does never switch back to a failed node. So, if node A fails, all traffic should go to node B, until I manually set node A to be healty (either via socat or with HAProxy's web UI).

Is there an option I am missing, or is HAProxy simply the wrong tool for it? As a side note, load balancing is not really necessary.

rexkogitans
  • 324
  • 1
  • 3
  • 22

1 Answers1

2

I think this question has already been asked: Prevent HAProxy from toggling back from fallback to master

Two solutions are proposed :

backend bk_app
 stick-table type ip size 1 nopurge
 stick on dst
 server s1 10.0.0.1:80 check
 server s2 10.0.0.2:80 check backup

I prefer the second solution because it is not a workaround.

Please have a look to the documentation about stick-table : http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#4-stick-table

rexkogitans
  • 324
  • 1
  • 3
  • 22
Maximilien D
  • 341
  • 1
  • 6