How to Configure Load Balancer with Pound in Ubuntu

To Configure Load Balance with Pound in Ubuntu

Pound is an open source lightweight software for reverse proxy and load balancing solution. As a reverse-proxy load balancing server, it allows the requests from the HTTP/HTTPS clients and distributes them to more than one Web servers. This article explains the configuration of Load balancer with Pound in Ubuntu.


Testing Environment


   IP Address   Hostname
Pound Load Balancer
Apache Webserver 1
Apache Webserver 2


Provide hostname resolution between the three machines either configure DNS server or create entry in /etc/hosts file. node1 node2 node3


Install Apache package on both of the web servers and configure basic Apache webserver with simple index.html file.

Installation of Pound package

First install the pound package on load balancer machine (node 1).


root@node1:~# apt-get install pound -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 435 not upgraded.

Preparing to unpack .../pound_2.6-6.1_amd64.deb ...
Unpacking pound (2.6-6.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Setting up pound (2.6-6.1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...

Create a new configuration file for pound and edit it as follows,

root@node1:~# mv /etc/pound/pound.cfg /etc/pound/pound.cfg.backup
root@node1:~# vim /etc/pound/pound.cfg


User "www-data"
Group "www-data"
# log level (max: 5)
LogLevel 3
# specify LogFacility
LogFacility local1
# interval of heartbeat - seconds
Alive 30
Control "/var/run/pound/poundctl.socket"

# define frontend
    Port 80

# define backend
        Port     80
        Priority 5

        Port     80
        Priority 5

Once the pound is configured, start and enable its service.

root@node1:~# sed -i -e "s/^startup=0/startup=1/" /etc/default/pound 
root@node1:~# systemctl start pound 

In addition, you need to configure rsyslog for pound.

root@node1:~# vi /etc/rsyslog.d/50-default.conf
#in line 9 change the entry as shown like below and add new line content on line 10
*.*;auth,authpriv.none;local1.none              -/var/log/syslog     
local1.*                        /var/log/pound.log 

Restart rsyslog service to take effect.

root@node1:~# systemctl restart rsyslog

Now its time to check the load balancer between the webserver nodes from web browser. Open the web browser with the IP address of the pound server.


For each and every request will be redirected to the different webservers.



Thank you! for using Linux Help.

You find this tutorial helpful? Share with your friends to keep it alive.
For more help topics browse our website
Be the first to comment, we value your suggestions. For further queries please comment below.

Tags: Load balancer
user image Author :  Connor