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 9th July 2008, 11:52
surfing86 surfing86 is offline
Junior Member
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default How To Set Up A Load-Balanced MySQL Cluster =>problem with virtual address

I have followed the tutorial "How To Set Up A Load-Balanced MySQL Cluster".
I encountered problems with connection to Data cluster from the load balancer :

My configuration :
load-balancer1 = 192.168.1.11
load-balancer2 = 192.168.1.12
datacluster1 = 192.168.1.21
datacluster2 = 192.168.1.22
virtual address of data cluster = 192.168.1.100

lb1:/home#mysql -h 192.168.1.100 -u ldirector
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.100'

lb1:/home# mysql -h 192.168.1.21 -u ldirector
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4882
Server version: 5.0.32-Debian_7etch5 Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

This is my /etc/ha.d/ldirectord.cf :

# Global Directives
checktimeout=10
checkinterval=2
autoreload=no
logfile="local0"
quiescent=yes
virtual = 192.168.1.100:3306
service = mysql
real = 192.168.1.21:3306 gate
real = 192.168.1.22:3306 gate
checktype = negotiate
login = "ldirector"
database = "ldirectordb"
request = "SELECT * FROM connectioncheck"
scheduler = wrr

This is my /etc/ha.d/haresources :

lb2 \
ldirectord::ldirectord.cf \
LVSSyncDaemonSwap::master \
IPaddr2::192.168.1.100/24/eth0/192.168.1.255

OUTput of command ip addr :

lb2:/etc/ha.d# ip addr sh eth0
2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 42:82:4e:d1:ac:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.12/24 brd 192.168.1.255 scope global eth0
inet 192.168.1.100/24 brd 192.168.1.255 scope global secondary eth0

Can you help me, please? Thank you
Reply With Quote
Sponsored Links
  #2  
Old 10th July 2008, 14:42
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Can you post the output of
Code:
netstat -tap
on datacluster1 and 2?
__________________
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 11th July 2008, 10:38
surfing86 surfing86 is offline
Junior Member
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Output on data1:

(none):~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:mysql *:* LISTEN 1088/mysqld
tcp 0 0 data1:mysql 192.168.1.11:56897 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56939 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56949 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.12:51725 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56885 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56905 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56901 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.12:51743 TIME_WAIT -
tcp 0 0 data1:40804 management:1186 ESTABLISHED1088/mysqld
tcp 0 0 data1:mysql 192.168.1.12:51721 TIME_WAIT -
tcp 0 0 data1:39640 data2:57594 ESTABLISHED1088/mysqld
tcp 0 0 data1:mysql 192.168.1.12:51745 TIME_WAIT -
tcp 31 0 data1:40806 management:1186 ESTABLISHED1088/mysqld
tcp 0 0 data1:mysql 192.168.1.11:56863 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56943 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56947 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.12:51703 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56957 TIME_WAIT -
tcp 0 0 data1:mysql 192.168.1.11:56951 TIME_WAIT -

Output on data2 :

(none):~# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 data2:50377 *:* LISTEN 992/ndbd
tcp 0 0 *:mysql *:* LISTEN 1096/mysqld
tcp 0 0 data2:57594 *:* LISTEN 992/ndbd
tcp 0 0 data2:mysql 192.168.1.12:59409 TIME_WAIT -
tcp 0 0 data2:57594 data1:39640 ESTABLISHED992/ndbd
tcp 0 0 data2:48438 management:1186 ESTABLISHED1096/mysqld
tcp 0 0 data2:48439 management:1186 ESTABLISHED992/ndbd
tcp 0 0 data2:mysql 192.168.1.11:48733 TIME_WAIT -
tcp 0 0 data2:59397 data2:50377 ESTABLISHED1096/mysqld
tcp 0 0 data2:mysql 192.168.1.11:48809 TIME_WAIT -
tcp 0 0 data2:48441 management:1186 ESTABLISHED1096/mysqld
tcp 0 0 data2:mysql 192.168.1.11:48739 TIME_WAIT -
tcp 0 0 data2:50377 data2:59397 ESTABLISHED992/ndbd
tcp 0 0 data2:48437 management:1186 ESTABLISHED992/ndbd

Which is the meaning of TIME_WAIT ?
Reply With Quote
  #4  
Old 11th July 2008, 11:29
surfing86 surfing86 is offline
Junior Member
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

output on data 2:

mysql> show processlist;
+----+----------------------+--------------------+------+---------+------+------
-+------------------+
| Id | User | Host | db | Command | Time | State
| Info |
+----+----------------------+--------------------+------+---------+------+------
-+------------------+
| 21 | root | localhost | NULL | Query | 0 | NULL
| show processlist |
| 34 | root | management:47837 | NULL | Sleep | 26 |
| NULL |
| 35 | root | management:47838 | NULL | Sleep | 26 |
| NULL |
| 37 | root | management:47839 | NULL | Sleep | 16 |
| NULL |
| 38 | root | management:47840 | NULL | Sleep | 16 |
| NULL |
| 39 | root | management:47841 | NULL | Sleep | 16 |
| NULL |
| 41 | root | management:47842 | NULL | Sleep | 6 |
| NULL |
| 42 | unauthenticated user | 192.168.1.11:33114 | NULL | Connect | NULL | login
| NULL |
| 43 | unauthenticated user | 192.168.1.11:33116 | NULL | Connect | NULL | login
| NULL |
| 44 | unauthenticated user | 192.168.1.12:33070 | NULL | Connect | NULL | login
| NULL |
+----+----------------------+--------------------+------+---------+------+------
-+------------------+

I get this message of unauthenticated user and therefore load balancer (.12 and .11) can't connect to data2.
All connections to 192.168.1.100 (virtual address ) are redirect on data2 and are not balanced between data1 and data2....
Reply With Quote
  #5  
Old 12th July 2008, 11:39
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Are you using a firewall on the dataclusters?
__________________
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
  #6  
Old 3rd October 2008, 18:54
zer0 zer0 is offline
Junior Member
 
Join Date: Oct 2008
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
 
Default

i've solved the problem....the thing was with the ldirectordb on the data nodes.
just have to set up correct username and passwd on the ldirectord.cf and that was it
Reply With Quote
The Following User Says Thank You to zer0 For This Useful Post:
falko (4th October 2008)
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
Virtual Users And Domains With Postfix, Courier And MySQL Secondary MX acoghlan HOWTO-Related Questions 1 8th March 2008 05:02
Set Up A Loadbalanced High-Availability Apache Cluster gg234 HOWTO-Related Questions 23 9th May 2007 18:45
Virtual Hosting: How do I set this up? VinceDee Installation/Configuration 7 12th December 2006 18:36
Another Problem: Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP bluegrass Installation/Configuration 24 8th March 2006 01:41
postfix config jmroth Installation/Configuration 6 18th September 2005 15:58


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


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