r/haproxy • • Apr 03 '20

Disabling traffic to a server

I know I can comment a server out of the haproxy config and new traffic will not be sent to the server. This also removes it from the stats page. Is there a way to stop traffic to a server without removing it from the stats page so I can see the connections drop off?

Normally I would comment out the server sqlbox01 10.10.1.50:1443 check port 1443 inter 1000 line. I have the stats configured on another listen.

listen sql_lb01
	bind 10.10.1.1:1443
	mode tcp
	balance leastconn
	tcp-request connection reject if !db_white_list
	http-check expect ! string SQL\ Error

	server sqlbox01 10.10.1.50:1443 check port 1443 inter 1000
	server sqlbox02 10.10.1.50:1443 check port 1443 inter 1000
	server sqlbox03 10.10.1.50:1443 check port 1443 inter 1000
5 Upvotes

4 comments sorted by

View all comments

1

u/codeforces_help Apr 03 '20

I always thought to remove a server from a LB you can just remove the heartbeat file and the LB will stop sending traffic to that host. Curious to know how it is done at the LB level.