Can anybody please guide me on HA Proxy as I am a newbies for it.
- How it works?
- How do I configure it?
- How do I modify(add/remove) the already configured file?
- How do I start/restart the HA Proxy after modifying the configuration file?
- Even I don't know how to check my current installed HA Proxy version?
Please guide me on the same.
I have already gone through the below URL,
http://haproxy.1wt.eu/download/1.3/doc/configuration.txt
Except the above URL please provide me some extra stuff, so I can start to work on it.
Best Answer
How it works Basically it's a load balancer. You put HAProxy in front of Web Servers, and it will split the load/traffic between them based on the balance algorithm you chose.
How do I configure it? It has a single config file /etc/haproxy/haproxy.cfg . For the most simple configuration you define one frontend with one or more backends (the web servers behind haproxy). Something like this:
How do I modify(add/remove) the already configured file? You just need to edit the file, At this time doesn't exist the option to use include files for configurarion. To apply the changes you need to restart haproxy.
How do I start/restart the HA Proxy after modifying the configuration file? If you have installed haproxy from a ubuntu/centos package you need:
/etc/init.d/haproxy restart
Even I don't know how to check my current installed HA Proxy version? If you're using CentOS:
rpm -qi haproxy
Check this document: http://haproxy.1wt.eu/download/1.3/doc/architecture.txt . It will guide you through different architectures for differente needs.