Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] Patch for ldirectord when using mysql service

 

 

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded


sm at mobiletech

Oct 26, 2007, 12:15 PM

Post #1 of 3 (355 views)
Permalink
[lvs-users] Patch for ldirectord when using mysql service

My first go at this mailing list, hope this is the place to post a
patch...

We're using a 2-server-cluster LVS and HA setup to have a loadbalanced
high available MySQL database server.
Currently running CentOS 5.0, MySQL 5.0.22 and the heartbeat packages
version 2.1.2.

We've been having some trouble getting ldirectord doing it's work when
it comes to adding real servers to the VIP host. The real-servers failed
due to errors in the ldirectord when checking the database with a
provided SELECT query. To get this working, we had to fix 2 very small
problem in ldirectord, in the check_sql method.

Ldirectord version string is "Linux Director v1.186-ha-2.1.2"

The patch:
--- /usr/sbin/ldirectord.org 2007-08-10 13:03:07.000000000 +0200
+++ /usr/sbin/ldirectord 2007-10-25 14:48:20.000000000 +0200
@@ -2672,7 +2672,7 @@
$$v{passwd});
unless ($dbh) {
check_sql_log_errstr("Failed to bind to $$r{server}
with",
- $dbh->errstr);
+ DBI->errstr);
goto err_down;
}
$result--;
@@ -2728,7 +2728,8 @@
# at a particular row. But I'm not going to worry about that for
# now.
$row = $sth->fetchrow_arrayref;
- unless ($row && $sth->err) {
+ # We don't want "unless $sth->err", this will only kick in when
error is NOT set
+ unless ($row && !$sth->err) {
check_sql_log_errstr("Error fetching row:",
$dbh->errstr);
goto err_finish;
}

mvh
Sverre Marvik
Head of System Operations
+47 95284007
www.mobiletech.no
Send MT to 2229

This message contains information that may be privileged or confidential
and is the property of "Mobiletech AS".

It is only intended for the person to whom it is addressed. If you are
not the intended recipient,
you are not authorized to read, print, retain, copy, disseminate,
distribute,
or use this message or any part thereof. If you receive this message in
error, please
notify the sender immediately and delete all copies of this message.

This email has been scanned for viruses by the anti-virus programs used
by Mobiletech AS


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


jmack at wm7d

Oct 26, 2007, 1:33 PM

Post #2 of 3 (328 views)
Permalink
Re: [lvs-users] Patch for ldirectord when using mysql service [In reply to]

On Fri, 26 Oct 2007, Sverre Marvik wrote:

> My first go at this mailing list, hope this is the place to post a
> patch...

the right place indeed. Thanks

Horms (the author of ldirectord) I'm sure will be glad to
see it. He's recoverging from a busy period right now, so he
may not get back to you immediately

Joe

--
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!

_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


horms at verge

Oct 28, 2007, 11:36 PM

Post #3 of 3 (321 views)
Permalink
Re: [lvs-users] Patch for ldirectord when using mysql service [In reply to]

On Fri, Oct 26, 2007 at 09:15:20PM +0200, Sverre Marvik wrote:
> My first go at this mailing list, hope this is the place to post a
> patch...
>
> We're using a 2-server-cluster LVS and HA setup to have a loadbalanced
> high available MySQL database server.
> Currently running CentOS 5.0, MySQL 5.0.22 and the heartbeat packages
> version 2.1.2.
>
> We've been having some trouble getting ldirectord doing it's work when
> it comes to adding real servers to the VIP host. The real-servers failed
> due to errors in the ldirectord when checking the database with a
> provided SELECT query. To get this working, we had to fix 2 very small
> problem in ldirectord, in the check_sql method.
>
> Ldirectord version string is "Linux Director v1.186-ha-2.1.2"
>
> The patch:
> --- /usr/sbin/ldirectord.org 2007-08-10 13:03:07.000000000 +0200
> +++ /usr/sbin/ldirectord 2007-10-25 14:48:20.000000000 +0200
> @@ -2672,7 +2672,7 @@
> $$v{passwd});
> unless ($dbh) {
> check_sql_log_errstr("Failed to bind to $$r{server}
> with",
> - $dbh->errstr);
> + DBI->errstr);
> goto err_down;
> }
> $result--;
> @@ -2728,7 +2728,8 @@
> # at a particular row. But I'm not going to worry about that for
> # now.
> $row = $sth->fetchrow_arrayref;
> - unless ($row && $sth->err) {
> + # We don't want "unless $sth->err", this will only kick in when
> error is NOT set
> + unless ($row && !$sth->err) {
> check_sql_log_errstr("Error fetching row:",
> $dbh->errstr);
> goto err_finish;
> }

Hi,

Thanks for bringing this to my attention. I have committed this change
and it should appear in the next release of linux-ha (which includes
ldirectord).

http://hg.linux-ha.org/dev/rev/b2f562475eae

--
Horms
H: http://www.vergenet.net/~horms/
W: http://www.valinux.co.jp/en/


_______________________________________________
LinuxVirtualServer.org mailing list - lvs-users[at]LinuxVirtualServer.org
Send requests to lvs-users-request[at]LinuxVirtualServer.org
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.