[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: MySQL Clustering; Load balancing is not working.



On Thu, 19 Feb 2009, Stackpole, Chris wrote:

> I wanted to learn more about MySQL clustering so I looked around and
> found this guide [1]. It was the newest guide I found (8 months old), so
> I decided to give it a shot. I went through the guide with a little
> deviation and I end up with mostly the same results as the author. Data
> written to one node, shows up real quick on the other node. The
> management interface all gives the same results as the author too.
> However, the big problem (and reason for my post) is the virtual IP for
> the load balancing doesn't work right.
>
> When I try connect to the virtual IP:
> $ mysql -h 10.0.1.10 -u ldirector -p
> Enter password:
> It will sit here for a really long time before giving:
> ERROR 2003 (HY000): Can't connect to MySQL server on '10.0.1.10' (111)
>

For most of this, you don't need to follow the instructions there to a
tee, where ever possible I just use what ever is in apt, most of it
version agnostic.  The real important thing, it just the methods.

> Step 2) Author uses MySQL 5.1.24 compiled from source. I used apt (I am
> not afraid to compile but I didn't because apt is awesome :).
> $ apt-cache show mysql-server | grep -i version
> Version: 5.0.51a-24
>
> Well, I guess I can see the versioning being a problem. Maybe I should
> update and compile a newer version. ??
>

> Step 6.1) For whatever reason, I can't update the GPG key for
> ultramonkey, but I just hit y to install anyway on apt. Also, he
> installs libdbd-mysql-perl from a download he gives from CPAN. I had
> errors with his commands. Turns out you have to install
> libmysqlclient15-dev (not 14) and you have to install make too! Then his
> link to the DBD-mysql-3.0002.tar.gz didn't work for me. However, the
> link to the newest (I believe) DBD-mysql-3.0008.tar.gz, _did_ work. So I
> installed that one. So again, versioning issues?
>

>From what I remember, ultramonkey is kind of dead.  All you really need to
install is ldirectord for the load balancing and heartbeat for failover,
both of which are in debians repositories.  So, I would just uninstall
everything you installed from ultramonkey, remove them from your sources
list and just install heartbeat and ldirector debians rep.

for the DBD-mysql, you can just install libdbd-mysql-perl, that will
provide what you need.

> Step 6.2 - 7) Everything works exactly as the author suggests it should,
> /except/ for the last line of:
> `mysql -h 10.0.1.10 -u ldirector -p`
>
> As stated before, this fails. I can ping 10.0.1.10. I can even ssh into
> 10.0.1.10. They both redirect me to the (current) primary load balancer.
> If I turn off the primary, I go to the secondary. Also, if I run
> `ipvsadm -L -n` I can see the connections show up, even though they time
> out. So I don't think it is the virtual part. I think it is the
> redirection to the MySQL session.
>
> The only thing I have found in the log files that doesn't look right, is
> every once in a while this line is put into the /var/log/ldirectord.log:
> Exiting with exit_status 2: configu_error: Configuration Error
> The thing is, from everything I can find, it is correct. I posted at the
 > end of the email.
>
> I would appreciate any feedback people may have.
>
> Thanks!
> ~Stack~
>
> [1]
> http://www.howtoforge.com/setting-up-a-loadbalanced-mysql-cluster-with-m
> ysql5.1
>
> $cat /etc/ha.d/ldirector.cf
> # Global Directives
> checktimeout=10
> checkinterval=2
> autoreload=no
> logfile="local0"
> quiescent=yes
> virtual=10.0.1.10:3306
>  service=mysql
>  real=10.0.1.33:3306 gate
>  real=10.0.1.34:3306 gate
>  checktype=negotiate
>  login="ldirector"
>  passwd="ldirectorpassword"
>  database="ldirectordb"
>  request="SELECT * FROM connectioncheck"
>  scheduler=wrr

your config looks ok.  The one other thing I would check is the entries in
your /etc/sysctl.conf to turn off arp.  That sounds like that may be the
main issue here



-- 
8 out of 10 Owners who Expressed a Preference said Their Cats Preferred Techno.


Reply to: