首页 > 技术文章 > HAproxy 添加多个配置文件

qianggezhishen 2016-11-09 11:49 原文

Here is how I manage this :

I write a different frontend/backend file for each frontend :

https://github.com/StevenLeRoux/webhub/blob/master/src/genconf.py

then when I start :

https://github.com/StevenLeRoux/webhub/blob/master/src/haproxyctl

is doing : CPPPCI HAPROXY_CONFDIR/HAPHOSTI HAPROXY_CONFDIR/backend -IHAPROXY C ONFDIR/frontendo HAPROXY_CONF $HAPROXY_CPP

which basically rebuild one config file. Very fast and you still have
the flexibility to manually remove a frontend quickly.

Note that the genconf.py is old now and need to be fixed (header
manipulations…)

推荐阅读