0

I am attempting to set up an haproxy LB for a cluster of mySQL slaves using the method outlined here in github's engineering blog. I've got the xinetd checks working but when I attempt to login via mysql client to the backend hosts through the haproxy endpoint, the client just hangs indefinitely. Curls appear to be reaching the backend host, but I see a "packets out of order" in the response:

[me@jump01 ~]$curl haproxy01.domain:3306/check-lag
5.6.32-78.1-log�m-}1w)`*O0��!�B:>da85>w`[)mysql_native_password!��#08S01Got packets out of order

here's a gist of the relevant haproxy.cfg for this proxy. Not sure what I'm missing here that's preventing the mysql client from getting to the backend.

Ethan Shrago
  • 101
  • 1
  • 8
  • Curl doesn't seem to be the best test method here. What happens when you use mysql command? – Joe Jul 21 '17 at 22:40

2 Answers2

0

The fact that your test gets mysql back shows it is getting to the destination server. However, the packets out of order may indicate that consecutive packets are getting to different backend servers. MySQL connections need to be stateful, and therefore sticky through a load balancer. I would change the config to be balance source which will keep all packets from one source IP going to the same backend unless it goes down, rather than balance roundrobin which will send them alternately to all backends.

Joe
  • 1,043
  • 8
  • 11
0

turns out the issue was the backend needed to be set to mode tcp. I figured it out when trying to telnet and doing a GET manually.

Ethan Shrago
  • 101
  • 1
  • 8