Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th June 2009, 01:14
mapcorp mapcorp is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Loadbalancing mysql with heartbeat not working

Hi,
I'm totally new with loadbalancing so please I need a bit of help.

Here's my scenario:
1 loadbalancer (lbsql1 192.168.0.7)
4 mysql server (192.168.0.51 -> 54)

Here's my config files:

lbsql1:~ # cat /etc/ha.d/ha.cf
logfacility local0
bcast
mcast eth0 225.0.0.1 694 1 0
auto_failback off
node lbsql1
respawn hacluster /usr/lib64/heartbeat/ipfail
apiauth ipfail gid=haclient uid=hacluster


lbsql1:~ # cat /etc/ha.d/haresources
lbsql1 ldirectord::ldirectord.cf LVSSyncDaemonSwap::master IPaddr2::192.168.0.7/24/eth0/192.168.0.255


lbsql1:~ # cat /etc/ha.d/authkeys
auth 3
3 md5 mypassword


lbsql1:~ # cat /etc/ha.d/ldirectord.cf
# Global Directives
checktimeout=10
checkinterval=2
autoreload=no
logfile="local0"
quiescent=yes
virtual=192.168.0.7:3306
service=mysqld
real=192.168.0.51:3306 gate
real=192.168.0.52:3306 gate
real=192.168.0.53:3306 gate
real=192.168.0.54:3306 gate
checktype=negotiate
login="ldirector"
passwd="ldirector"
database="ldirectordb"
request="SELECT * FROM connectioncheck"
scheduler=wrr



When I try to connect from my application it fails...
How can I track the problem?

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 29th June 2009, 13:58
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

What are the outputs of
Code:
netstat -tap
and
Code:
ifconfig
on the load balancer? Any errors in the logs?
__________________
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
  #3  
Old 29th June 2009, 14:35
mapcorp mapcorp is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when I start heartbeat shows me some warnings....but it starts
lbsql1:~ # /etc/init.d/heartbeat start
Starting High-Availability serviceslogd is already running
/etc/init.d/heartbeat: line 142: /usr/lib64/heartbeat/ResourceManager: No such file or directory
heartbeat: baudrate setting must precede media statementsheartbeat[8443]: 2009/01/14_14:33:00 WARN: Core dumps could be lost if multiple dumps occur.
heartbeat[8443]: 2009/01/14_14:33:00 WARN: Consider setting non-default value in /proc/sys/kernel/core_pattern (or equivalent) for maximum supportability
heartbeat[8443]: 2009/01/14_14:33:00 WARN: Consider setting /proc/sys/kernel/core_uses_pid (or equivalent) to 1 for maximum supportability
heartbeat[8443]: 2009/01/14_14:33:00 info: Version 2 support: false
heartbeat[8443]: 2009/01/14_14:33:00 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat[8443]: 2009/01/14_14:33:00 info: **************************
heartbeat[8443]: 2009/01/14_14:33:00 info: Configuration validated. Starting heartbeat 2.99.4
done


however seems not listening at port 3306

lbsql1:~ # netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:sunrpc *:* LISTEN 2270/rpcbind
tcp 0 0 *:ssh *:* LISTEN 2800/sshd
tcp 0 0 localhost:smtp *:* LISTEN 2763/master
tcp 0 0 lbsql1:ssh 192.168.0.18:39565 ESTABLISHED 8392/1
tcp 0 0 *:sunrpc *:* LISTEN 2270/rpcbind
tcp 0 0 *:ssh *:* LISTEN 2800/sshd


lbsql1:~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:02:A0:AD
inet addr:192.168.0.7 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe02:a0ad/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27698 errors:0 dropped:0 overruns:0 frame:0
TX packets:10667 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8036039 (7.6 Mb) TX bytes:2501689 (2.3 Mb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:772 (772.0 b) TX bytes:772 (772.0 b)
Reply With Quote
  #4  
Old 30th June 2009, 15:12
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
Default

Is 192.168.0.7 the regular IP address of the load balancer? The virtual IP must be an additional IP, i.e., the load balancer's main IP should be different.
__________________
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 30th June 2009, 15:18
mapcorp mapcorp is offline
Junior Member
 
Join Date: Jun 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes 192.168.0.7 is the regular and physical IP for the load balancer..Do I need a Virtual IP even when there's only 1 machine acting as loadbalancer?
Reply With Quote
  #6  
Old 1st July 2009, 15:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,752 Times in 2,582 Posts
 
Default

Yes, please use a virtual IP.
__________________
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
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
LB1 Not Taking Over Shared IP Using Heartbeat 2.1.3 On FC10 64Bit asyadiqin Installation/Configuration 5 11th February 2009 21:11
Management/system config/settings & /server/settings not working!! dactor Installation/Configuration 9 6th February 2008 10:11
Messed up ISPConfig-2.2.8 Upgrade Morons Installation/Configuration 4 29th November 2006 13:17
PHP & MySQL working, but AREN'T WORKING???? lipp9000 Installation/Configuration 4 21st July 2006 18:01
Mandriva 10.2 Perfect Setup Install Problems... ctroyp Installation/Configuration 12 30th December 2005 17:04


All times are GMT +2. The time now is 09:21.


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