Slightly related to " Other options to "balance source" in haproxy", I would like to know what ports are currently pointed where.
To confirm, I'm using haproxy to distribute clients which make only a single connection at a time to a different port on the proxy, to different backend servers. Assume the protocol is ssh.
I'm using a stick-table to keep clients to one backend server until that server goes down. What's the best way to find out what the current state is?
I know I could make one frontend for each port then point them all at the same backend. The name of the frontend is then logged but i can't help but want one neat frontend with a range of ports and then dst_port logged.
Best Answer
My current answer/solution (mentioned in the question) is as follows.
I define a different 'listen' for each port to be bound with a recognisable name.
I then ensure
option tcplog
is enabled for that frontend.The logging then provides me the two pieces of information I need. The frontend and backend used.
e.g.
I parse that log file 'magically' and use that information to present the latest status.
option logasap
helps..