Reload haproxy.cfg without restarting

2670阅读 0评论2013-01-25 flyzzy
分类:LINUX

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.

上一篇:使用tmpfs 虚拟文件系统
下一篇:Install Intel 82576 Gigabit Network driver on CentOS6