0

Let's say if I have two mysql databases, db1 and db2. Is that possible to configure haproxy to work like that:

  1. In the beginning: db1 work as master and db2 as backup.
  2. The haproxy will promote db2 as master when db1 is down.
  3. The haproxy will not use db1 even when db1 is recovered.
  4. The haproxy will promote db1 as master again when db2 is down.

I have read some answers in stackoverflow. But they only figure out the first 3 requirements. ( such as HAProxy switch only in case of server down )

Thank you for your time.

PS: My Platform: Redhat Haproxy Version: 1.5.2

1 Answer 1

1

You can use a stick table in HAProxy and the tips used in this blog article: http://blog.haproxy.com/2014/01/17/emulating-activepassing-application-clustering-with-haproxy/

It describes how to fix your 4 points.

Baptiste

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .