I'm using HAProxy for mysql database backends. The database had to be master-slave. The goal is to point all mysql clients at the proxy and for all requests to go to mysql server #1 and only go to mysql server #2 if #1 is down.
There is an understanding and acceptance that when we are failed over to node 2, the database will be read only.
One thing I tried was setting the weight of node 1 to 256 and this kind of works but I don't want one out of 256 database calls going to node2; I need all calls to get directed to node1 unless node1 is actually down.