Friday, January 1, 2021

APACHE Load balancing using pound

 

Pound load balancer is used as reverse proxy server . It will distribute request to the backend servers.backend server is configure by Apache server  which will accept the incoming request from port 80 & 443 . Then it will distribute the request to backend one or more servers.
Example:-
if we have two backend servers first request will go to Apache web server1 & then to Apache web server2 and  then pound server will deliver the content back to clients as per the request (reverse proxy).


Configure Pound load-balancer:-

Pound Server1 :#pound.example.comStep 1:-
  • We have to installed pound load balancer  (epel repository).
  •  Install EPEL repository using the following steps.

Install both EPEL repository at Pound Server1

RHEL/CentOS 7


IP ADDRESS :- 192.168.0.10

root@pound~#rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm

root@pound~# yum install pound

We need to two machine for backend server

Server 1 :  HOSTNAME :-  server1.example.com 

                 IP ADDRESS :- 192.168.0.11

Server 2 :  HOSTNAME :-  server2.example.com 

                  IP ADDRESS :- 192.168.0.12

Now Configure Pound server :-

root@pound~#systemctl restart pound

root@pound~#vim  /etc/pound.cfg
                      ListenHTTP
                           Address  192.168.0.10
                           Port 80
                      End

                      ListenHTTPS
                           Address  192.168.0.10
                           Port    443
                      Cert    "/etc/pki/tls/certs/pound.pem"
                      End

                      Service
                        BackEnd
                              Address 192.168.0.11
                              Port    8888
                        End

                       BackEnd
                              Address 192.168.0.12
                              Port    8181  
                       End
                    End

 (SAVE AND EXISTS)

root@pound~#systemctl restart pound

Checking the load balancer

To check the load balancer, open browser and enter the Pound server’s IP address  192.168.0.10. It will open the web page  page & you will then be redirected to web server 2 and web server 1.

Refreshing web page and  you will see that one request goes to server 1 and then to server 2.

When some one send request one server pound server is redirect request one server to other server and hide original IP server .







No comments:

Post a Comment