分类: LINUX
2013-01-25 14:59:23
When you make adjustments to the haproxy configuration file (haproxy.cfg), you need to restart the load balancer before the new configurations take effect. For a high traffic site, this is a painful process – any downtime is noticable by the users. There is a way to reload the config file gracefully, without causing interruption to users – but this is hidden in the great txt based documentation for haproxy. For your delight, here it is:
# haproxy -f /etc/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
All you need to do, is make sure you pass in the correct location for the haproxy configuration file, and the pid.
-sf specifies a list of pids to send a FINISH signal to after startup.