1 / 15

Load balanced High-Availability Apache Cluster

Load balanced High-Availability Apache Cluster. Advantage Of Load Balancing. Load balancers takes care of the load on a web server nodes and tried to direct request to the node with least amount on load

Download Presentation

Load balanced High-Availability Apache Cluster

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Load balanced High-Availability Apache Cluster

  2. Advantage Of Load Balancing Load balancers takes care of the load on a web server nodes and tried to direct request to the node with least amount on load Many web applications make use of sessions, and if you are in a session on Apache node 1, you would lose that session if suddenly node 2 served your requests. If an Apache nodes goes down, the load balancer realizes that and directs all incoming requests to the remaining node.

  3. Requirements For Setup • Four nodes( two apache nodes and two load balancer nodes) • Five IP Addresses • One for each node • One for virtual IP address that will be shared by the load balancer.

  4. IP Address Schema Apache node 1: webserver1.radford.edu(webserver1) - IP address: 192.168.0.101; Apache document root: /var/www Apache node 2: webserver2.radford.edu(webserver2) - IP address: 192.168.0.102; Apache document root: /var/www Load Balancer node 1: loadb1.radford.edu (loadb1) - IP address: 192.168.0.103 Load Balancer node 2: loadb2.radford.edu (loadb2) - IP address: 192.168.0.104 Virtual IP Address: 192.168.0.105 (used for incoming requests)

  5. Enable IPVS On The Load Balancers • Loadb1 / Loadb2 • echo ip_vs_dh >> /etc/modulesecho ip_vs_ftp >> /etc/modulesecho ip_vs >> /etc/modulesecho ip_vs_lblc >> /etc/modulesecho ip_vs_lblcr >> /etc/modulesecho ip_vs_lc >> /etc/modulesecho ip_vs_nq >> /etc/modulesecho ip_vs_rr >> /etc/modulesecho ip_vs_sed >> /etc/modulesecho ip_vs_sh >> /etc/modulesecho ip_vs_wlc >> /etc/modulesecho ip_vs_wrr >> /etc/modules

  6. modprobeip_vs_dhmodprobeip_vs_ftpmodprobeip_vsmodprobeip_vs_lblcmodprobeip_vs_lblcrmodprobeip_vs_lcmodprobeip_vs_nqmodprobeip_vs_rrmodprobeip_vs_sedmodprobeip_vs_shmodprobeip_vs_wlcmodprobeip_vs_wrrmodprobeip_vs_dhmodprobeip_vs_ftpmodprobeip_vsmodprobeip_vs_lblcmodprobeip_vs_lblcrmodprobeip_vs_lcmodprobeip_vs_nqmodprobeip_vs_rrmodprobeip_vs_sedmodprobeip_vs_shmodprobeip_vs_wlcmodprobeip_vs_wrr

  7. Install Ultra Monkey On The Load Balancers • vi /etc/apt/sources.list • Lines must be added • deb http://www.ultramonkey.org/download/3/ sarge main • deb-src http://www.ultramonkey.org/download/3 sarge main • apt-get update • apt-get install ultramonkey

  8. UltraMonkey Setup Do you want to automatically load IPVS rules on boot?<-- No Select a daemon method.<-- none

  9. Enable Packet Forwarding On Load Balancers • vi /etc/sysctl.conf • Add the following lines to sysct1.conf file • Net.ipv4.ip_forward = 1 • sysctl -p

  10. Configure heartbeat And Idirectord • vi /etc/ha.d/ha.cf • Add to config file • logfacility local0 • bcast eth0 # Linux • mcast eth0 225.0.0.1 694 1 0 • auto_failback off • node loadb1 • node loadb2 • respawnhacluster /usr/lib/heartbeat/ipfail • apiauthipfailgid=haclientuid=hacluster

  11. uname -n • vi /etc/ha.d/haresources • loadb1 \ • ldirectord::ldirectord.cf \ • LVSSyncDaemonSwap::master \ • IPaddr2::192.168.0.105/24/eth0/192.168.0.255

  12. uname –n • vi /etc/ha.d/authkeys • auth 3 • 3 md5 somerandomstring • chmod 600 /etc/ha.d/authkeys

  13. vi /etc/ha.d/ldirectord.cf • checktimeout=10checkinterval=2autoreload=nologfile="local0"quiescent=yesvirtual=192.168.0.105:80real=192.168.0.101:80 gatereal=192.168.0.102:80 gatefallback=127.0.0.1:80 gateservice=httprequest="ldirector.html"receive="Test Page"scheduler=rrprotocol=tcpchecktype=negotiate

  14. update-rc.d heartbeat start 75 2 3 4 5 . stop 05 0 1 6 . update-rc.d -f ldirectord remove /etc/init.d/ldirectord stop /etc/init.d/heartbeat start

More Related