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 22nd February 2007, 20:28
Jan VdV Jan VdV is offline
Junior Member
 
Join Date: Feb 2007
Location: Leuven, Belgium
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Installed nfs cluster, now only 1 connection out of two 2 works

Hello again,

I'm struggling with my mysql cluster which seems to have some hickups.

I try to explain:

I have two load balancers (master - backup) load balancing two webservers. The load balancers load balance also two data servers running a mysql cluster. These two data servers also run a nfs.

I've used the 192.168.0.0/24 network for the internal network, to the outside I connect to the 172.16.9.0/24 network of our university 's lab. I also use a 192.168.1.0/24 network to connect the two load balancers with eachother (which is rather useless but it seemed a good idea at the time).

Three virtual ip addresses have been configured on the load balancers, one for each network.

Via masquerading I connected the webservers so that the 172.16.9.x virtual ip's passes requests on port 80 to the webservers.
I then set up the nfs cluster. Between the two data servers I used heartbeat (according to Falko Timme's tutorial) and that also went fine. The nfs listens to 192.168.0.20 (a virtual ip set up on the two data servers).
All servers (so the 2 webservers and the 2 data servers) use the 192.168.0.x virtual ip address as default gateway. So the load balancers also function as a router for that matter. This all works fine.

Finally I've set up the sql server: the two sql databases are run from the data servers, the management server is installed on the first load balancer (again according to one of Falko Timme's fine tutorials). When I tried to use the 192.168.0.x virtual ip to connect the mysql cluster to, I couldn't get it to work. I presume the masquerading prevents a good connection.
So I've set up the cluster to listen to the virtual 192.168.1.x. I presumed I'd had to use masquerading too since the virtual ip address is on another network as the actual mysql servers, but when nmapping to this virtual address, I saw that port 3306 was filtered.
I then changed the config of the real servers in /etc/ha.d/ldirectord.cf from masq to gate and tried again. To my surprise it now stated 'open' instead of 'filtered'.
So I thought all problems were solved. But when making a mysql connection using [/CODE]mysql -u user -h 192.168.1.x -p[/CODE] I only can connect every second time (connecting from one of the webservers via my-sqlclient-4.1).
When disconnecting one of the two nodes the problem seems solved no matter which data server is disconnected.
So actually installing a load balanced mysql cluster decreased availability with 50%?
I also can connect without problems directly to each one of the nodes.

Can anybody help me out? (P.S: my excuses for the elaborate explanation )


Here are some configuration files:
/etc/ha.d/ldirectord.cf:
Code:
checktimeout=2
checkinterval=1
autoreload=no
logfile="local0"
quiescent=yes
virtual=172.16.9.240:80
        real=192.168.0.11:80 masq
        real=192.168.0.12:80 masq
        fallback=127.0.0.1:80
        service=http
        request="ldirector.html"
        receive="Test Page"
        scheduler=rr
        protocol=tcp
        checktype=negotiate
virtual = 192.168.1.240:3306
        service = mysql
        real = 192.168.0.21:3306 gate
        real = 192.168.0.22:3306 gate
        checktype = negotiate
        login = "ldirector"
        passwd = "ldirectorpassword"
        database = "ldirectordb"
        request = "SELECT * FROM connectioncheck"
        scheduler = wrr
/etc/network/interfaces from load balancer 1:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 172.16.9.2
netmask 255.255.255.0
network 172.16.9.0
broadcast 172.16.9.255
gateway 172.16.9.254

auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255


auto eth2
iface eth2 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
up iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.0.0/24
down iptables -t nat -D POSTROUTING -j MASQUERADE -s 192.168.0.0/24
Reply With Quote
Sponsored Links
  #2  
Old 23rd February 2007, 12:22
Jan VdV Jan VdV is offline
Junior Member
 
Join Date: Feb 2007
Location: Leuven, Belgium
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have located the problem, so this thread is closed.
Reply With Quote
  #3  
Old 23rd February 2007, 12:28
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 880
Thanks: 1
Thanked 18 Times in 17 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

Could you, for the archives, indicate how you solved the problem or what the cause was?
Reply With Quote
  #4  
Old 23rd February 2007, 20:31
Jan VdV Jan VdV is offline
Junior Member
 
Join Date: Feb 2007
Location: Leuven, Belgium
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will post my solution tomorrow or the day after tomorrow. I have to make a tutorial so that other student are able to reconstruct my whole setup, which I'm going to do this weekend.
The problems of my setup came from the combination of the sql cluster, the apache cluster and a nfs.
This problem in particuliar was caused by two lines of code in /etc/network/interfaces:
Code:
up iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.0.0/24
down iptables -t nat -D POSTROUTING -j MASQUERADE -s 192.168.0.0/24
Thanks for the reply!
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
Getting e-mail working hansoffate Installation/Configuration 29 13th August 2008 16:33
My php scripts don't send e-mail html forms. CombatGod Installation/Configuration 5 8th November 2006 10:16
kann keine mails empfangen odin1 Installation/Configuration 5 6th July 2006 12:13
Email seemingly not working... Duplex Installation/Configuration 11 19th April 2006 14:48
Perfect Xen 3.0 setup for Debian gurneyzap HOWTO-Related Questions 4 26th March 2006 11:30


All times are GMT +2. The time now is 08:26.


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