HAProxy community

Multiple instances of haproxy using one binary

Can we create multiple instances of haproxy using one core hap binary ?

I came accross
/usr/sbin/haproxy -D -f /etc/haproxy/dummy/haproxy_s.cfg -p /var/run/haproxy_s.pid

Which creates an instance ,but how to stop or restart the “dum” instance

It can be done, but you need to adjust the init.d/systemd unit files yourself, and make sure there is no conflict.

The init.d config is for bringing up the hap on reboot right ?

And how can we configure custom log paths for these instances , lets say i have instance1,instance2 and instance3 and by default it logs at /var/log , how can i configure the such a way that the logs be logged at /var/log/inst1 ,/var/log/inst2 respectively

You have to take care of everything, read the documentation about logging in haproxy and of the syslog product you are using.

There is no ready-for-use solution here, you have to put in the work.