How To Set Up A Loadbalanced High-Availability Apache Cluster - Page 3
5 Test The Load BalancersLet's check if both load balancers work as expected: loadb1/loadb2: ip addr sh eth0 The active load balancer should list the virtual IP address (192.168.0.105):
The hot-standby should show this:
loadb1/loadb2: ldirectord ldirectord.cf status Output on the active load balancer:
Output on the hot-standby:
loadb1/loadb2: ipvsadm -L -n Output on the active load balancer:
Output on the hot-standby:
loadb1/loadb2: /etc/ha.d/resource.d/LVSSyncDaemonSwap master status Output on the active load balancer:
Output on the hot-standby:
If your tests went fine, you can now go on and configure the two Apache nodes.
6 Configure The Two Apache NodesFinally we must configure our Apache cluster nodes webserver1.example.com and webserver2.example.com to accept requests on the virtual IP address 192.168.0.105. webserver1/webserver2: apt-get install iproute Add the following to /etc/sysctl.conf: webserver1/webserver2: vi /etc/sysctl.conf
Then run this: webserver1/webserver2: sysctl -p Add this section for the virtual IP address to /etc/network/interfaces: webserver1/webserver2: vi /etc/network/interfaces
Then run this: webserver1/webserver2: ifup lo:0 Finally we must create the file ldirector.html. This file is requested by the two load balancer nodes repeatedly so that they can see if the two Apache nodes are still running. I assume that the document root of the main apache web site on webserver1 and webserver2 is /var/www, therefore we create the file /var/www/ldirector.html: webserver1/webserver2: vi /var/www/ldirector.html
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning
Learn benefits of Simpana software.
View the Gartner Video




print: 

Recent comments
20 hours 6 min ago
21 hours 1 min ago
1 day 23 min ago
1 day 5 hours ago
1 day 6 hours ago
1 day 13 hours ago
1 day 13 hours ago
1 day 14 hours ago
1 day 16 hours ago
1 day 18 hours ago