Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 4th April 2007, 12:56
manurro manurro is offline
Junior Member
 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Loadbalanced High-Availability Apache Cluster

Hi all,

I'm building a Loadbalanced HA Apache Cluster following the HOW-TO from Falko.
I've done everything as he explained just changing my nodenames and IP's, and it all seems to be fine, but when I start heartbeat on both loadb servers, they both become active, when they're supposed to be one active and the other on hot-standby. I've checked config files a thousand times and I can't guess what's going wrong. Below I attach my config files on load balancers.

LOADB1 & LOADB2 (as config files must be identical)

/etc/ha.d/ha.conf

Code:
logfacility     local0
bcast   eth0
mcast   eth0 225.0.0.1 694 1 0
auto_failback on
node loadb1.mydomain.com
node loadb2.mydomain.com
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster
/etc/ha.d/haresources

Code:
loadb1.mydomain.com ldirectord::ldirectord.cf LVSSyncDaemonSwap::master IPaddr2::xxx.xxx.xxx.xxx/27/eth0/nnn.nnn.nnn.nnn
(Where xxx.xxx.xxx.xxx is the VIP and nnn.nnn.nnn.nnn the network address)

/etc/ha.d/ldirectord.cf

Code:
checktimeout=10
checkinterval=2
autoreload=no
logfile="local0"
quiescent=yes

virtual=xxx.xxx.xxx.xxx:80
        real=yyy.yyy.yyy.yyy:80 gate
        real=zzz.zzz.zzz.zzz:80 gate
        fallback=127.0.0.1:80 gate
        service=http
        request="ldirector.html"
        receive="Test Page"
        scheduler=rr
        protocol=tcp
        checktype=negotiate
(yyy.yyy.yyy.yyy and zzz.zzz.zzz.zzz are the apache nodes)

That's the output a few seconds after I started heartbeat on both servers:

Loadb1

Code:
# ip addr sh eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:17:08:50:3e:f6 brd ff:ff:ff:ff:ff:ff
    inet aaa.aaa.aaa.aaa/27 brd nnn.nnn.nnn.nnn scope global eth0
    inet xxx.xxx.xxx.xxx/27 brd nnn.nnn.nnn.nnn scope global secondary eth0
    inet6 fe80::217:8ff:fe50:3ef6/64 scope link
       valid_lft forever preferred_lft forever
Loadb2

Code:
# ip addr sh eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:16:35:5c:f8:f4 brd ff:ff:ff:ff:ff:ff
    inet bbb.bbb.bbb.bbb/27 brd nnn.nnn.nnn.nnn scope global eth0
    inet xxx.xxx.xxx.xxx/27 brd nnn.nnn.nnn.nnn scope global secondary eth0
    inet6 fe80::217:8ff:fe50:3ef6/64 scope link
       valid_lft forever preferred_lft forever
(aaa.aaa.aaa.aaa and bbb.bbb.bbb.bbb are the adrresses for loadb1 and loadb2).

My OS is Fedora Core 5 on all servers (load balancers and apache nodes).
Please anyone can help me?

Thanks in advance.
Reply With Quote
Sponsored Links
  #2  
Old 5th April 2007, 11:28
manurro manurro is offline
Junior Member
 
Join Date: Apr 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, it was an IPTABLES issue, I should have checked that before

For those who may have same issue, adding that to iptables config file fixed my problem:
Loadb1
Code:
-A RH-Firewall-1-INPUT -p ip -m comment -m state -s bbb.bbb.bbb.bbb --state NEW -j ACCEPT --comment Hearbeat
-A RH-Firewall-1-INPUT -p ip -m comment -m state -s xxx.xxx.xxx.xxx --state NEW -j ACCEPT --comment Hearbeat
Loadb2
Code:
-A RH-Firewall-1-INPUT -p ip -m comment -m state -s aaa.aaa.aaa.aaa --state NEW -j ACCEPT --comment Hearbeat
-A RH-Firewall-1-INPUT -p ip -m comment -m state -s xxx.xxx.xxx.xxx --state NEW -j ACCEPT --comment Hearbeat
(aaa.aaa.aaa.aaa is loadb1's IP, bbb.bbb.bbb.bbb loadb2's IP and xxx.xxx.xxx.xxx is the virtual IP)

Regards!
Reply With Quote
  #3  
Old 9th April 2007, 17:29
pajatzo pajatzo is offline
Junior Member
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Virtual IP on two machines

Hi all

Ive just completed the howto, and one thing hit me. If the two apache nodes answer to the reply on the new virtual address, whats from stopping the network traffic to get to them directly? If I stop the ldirectord and ultra monkey on the load balancer the setup still works, I get an error the first time I load the virtual URL but the second time I get in contact with one server. Does this present some error to the setup that I havent understood? Is the apache nodes supposed to sit on a private network behind the load balancers? Do I need two NICs in the load balancers?

I must also say that I havent followed the howto exactly; I have done it with a twist you might say. The two apache nodes run FreeBSD and the NICs on those machines have there real address and an alias with the virtual address.
Reply With Quote
  #4  
Old 10th April 2007, 15:46
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

Quote:
Originally Posted by pajatzo
whats from stopping the network traffic to get to them directly?
Nothing, the nodes can still answer on their own IP addresses.

Quote:
Originally Posted by pajatzo
Is the apache nodes supposed to sit on a private network behind the load balancers?
Not necessarily. But it will be more difficult to configure a virtual IP address with public IP addresses, whereas you can do whatever you want with private IP addresses.


Quote:
Originally Posted by pajatzo
Do I need two NICs in the load balancers?
If you load balancers should have a public and private IP address at the same time, then yes.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 10th April 2007, 15:59
pajatzo pajatzo is offline
Junior Member
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by falko
Nothing, the nodes can still answer on their own IP addresses.
Yes but they will also answer on the virtual chared IP address, correct? They will be reachably by two adresses each.

Can you also specify if the arp... changes to the kernel on the apache nodes apply to ignore warnings about several machines on the network using the same IP, this is an error that I get on the nodes, running FreeBSD.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
High Availability Samba cluster - DRBD + Heartbeat djalex Server Operation 58 25th May 2007 19:38
Set Up A Loadbalanced High-Availability Apache Cluster gg234 HOWTO-Related Questions 23 9th May 2007 18:45
Loadbalanced High-Availability Apache Cluster - DNS Problem pimadaum HOWTO-Related Questions 3 24th January 2007 13:04
Loadbalanced Apache Cluster Help brianwebb01 Installation/Configuration 2 18th October 2006 17:01
Problem with the installation of Dokeos (LMS) in ISPConfig jofranco General 4 28th April 2006 00:45


All times are GMT +2. The time now is 23:10.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.