How to setup Web server load balancing using POUND
To setup Web server load balancing using POUND
In this article we are going to learn about POUND &ndash to load balancer for Web servers. It is developed by ITSECURITY company, which is a open source light weight reverse proxy tool. One of the advantage is When a back end server is failed or recovered from a failure, it detects automatically and manage the load in stable.
For this setup I have taken the following IP’ s
Pound Gateway Server : 192.168.5.55
Web Server 01 : 192.168.5.80
Web Server 02 : 192.168.5.207
To install Pound Load Balancer on Gateway Server
Using pre-compiled RPM packages to install Pound.
http://www.invoca.ch/pub/packages/pound/
Or else by enabling the epel repo,
I have taken EPEL repository to install,
[root@linuxhelp~]# yum install epel-release
[root@linuxhelp~]# yum install &ndash enablerepo=epel Pound
here ‘ P’ in pound should be in Uppercase, if not it returns no package available.
To verify installed or not using the below command,
[root@linuxhelp~]# rpm &ndash qa |grep Pound
Pound-2.6-2.el6.1.x86_64
To Configure Pound Load Balancer
Once its installed, move to configuration. The location of configuration file is /etc/pound.cfg
We have to make the change as mentioned below,
[root@linuxhelp~]# vi /etc/pound.cfg
User " pound"
Group " pound"
Control " /var/lib/pound/pound.cfg"
ListenHTTP
Address 192.168.5.55
Port 80
End
ListenHTTPS
Address 192.168.5.55
Port 443
Cert " /etc/pki/tls/certs/pound.pem"
End
Service
BackEnd
Address 192.168.5.80
Port 24865
End
BackEnd
Address 192.168.5.207
Port 2222
End
End
pound.cfg looks like as I shown, you can change according to your server’ s IP as well as port number.
As a default, HTTP requests the port 80 and HTTPS requests the port 443. You can add any sub tags under the service tag. BackEnd tags i.e., sub tag bears the IP address.
Just save after editing over and start again the POUND by giving below commands,
[root@linuxhelp~]# /etc/init.d/pound restart
OR
[root@linuxhelp~]# service pound restart
OR
[root@linuxhelp~]# systemctl restart pound.service
Type the POUND gateway’ s IP address in the address bar to check configurations work fine.
In the two web browsers, First it loads the first web server and second it loads second web server.
Here, you can see the load is equally splits to both servers, we can add one more parameter called Priority to load the web server which we are giving higher priority.
Example:
If am having the first web server with higher specifications compared to second one, so I give priority to first since it will give more load to the first web server.
For Priority, we have to use range 1-9 and the default value is 5.
You have to change the priority in the main configuration file,
In /etc/pound.cfg
&hellip
&hellip
BackEnd
Address 192.168.5.80
Port 24865
Priority 6
End
I have given the higher priority to 192.168.5.80 web server.
Here, it will give the higher load to first web server as shown here,
To plan Emergency Breakdowns
If suppose, all the back end servers are dead then we have to use Emergency Tag like below,
“ Emergency Address 192.168.7.13 Port 24865 End”
Assume both the servers are dead now, if I call the pound IP from browser then it will now retrieve the Emergency server which I mentioned here is, 192.168.7.13.
You can also define the seconds, when it checkout the back end servers by adding the parameter “ Alive” in the file pound.cfg.
Example: “ Alive 30” refers set it to 30 seconds.
POUND will check the back end servers whether it is disabled or dead, as you mentioned time in the pound.cfg file. Once it found that the servers are dead then it retrieves the emergency server.
Comments ( 0 )
No comments available