PC-23

"Sebaik-baik manusia adalah mereka yang bermanfaat bagi orang lain"

Breaking

Thursday, March 15, 2018

Lab 8.10 Use Mod Proxy of Load Balancing with "lbmethod"


Pada kesempatan kali ini saya akan berbagi kepada anda, yaitu konfigurasi Use Mod Proxy of Load Balancing with "lbmethod"

Berikut Konfigurasinya :


3 server
1. www.tkj.net = 192.168.43.100 (control) 
2. node1.tkj.net = 192.168.43.101 (node1) 
3. node2.tkj.net = 192.168.43.102 (node2) 

- configure DNS for www.tkj.net, node1.tkj.net, and node2.tkj.net in server control 
- configure DNS node1.tkj.net in server node1 and install httpd 
- configure DNS node2.tkj.net in server node2 and install httpd

configure load balance in server control

[root@control ~]# nano /etc/httpd/conf.d/r_proxy.conf
----------------------------------------------------------------------------------------
# create new 
<IfModule mod_proxy.c> 
      ProxyRequests Off 
      <Proxy *> 
            Require all granted 
      </Proxy> 
      # specify the way of load balancing with "lbmethod". it's also possible to set "bytraffic". 
      ProxyPass / balancer://cluster lbmethod=byrequests 
      <proxy balancer://cluster> 
             BalancerMember http://node1.tkj.net/ loadfactor=1  
             BalancerMember http://node2.tkj.net/ loadfactor=1
      </proxy> 
</IfModule> 
--------------------------------------------------------------------------------------

[root@control ~]# systemctl restart httpd

----------------------------------------------------------------------------------------

akses situs http://www.tkj.net/

Semoga Bermanfaat :)

No comments:

Post a Comment