Mailing List Archive

MySQL Server
Hi,

it is possibli to use a MySQL Server with the LVS System because of the
variable Database from the MySQL Server? How to sync the Databases from
the Different Servers?


Best regards

Manuel
Re: MySQL Server [ In reply to ]
Hi Manuel,

Yes, it is definitely possible.
Two options that I'd look into would be as follows:

1. Use a shared file system such as NFS
so that you won't have any synchronization
issues.

2. Use mySQL's new replication, and either build
it into your application, or use heartbeat to
have one database failover.

We've had success with both of these methods.

Hope this helps.

Cheers,
Raj Dutt
Voxel dot Net, Inc.

Manuel Jenne wrote:
>
> Hi,
>
> it is possibli to use a MySQL Server with the LVS System because of the
> variable Database from the MySQL Server? How to sync the Databases from
> the Different Servers?
>
> Best regards
>
> Manuel
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> Send requests to lvs-users-request@LinuxVirtualServer.org
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
Re: MySQL Server [ In reply to ]
Manuel Jenne wrote:

> it is possibli to use a MySQL Server with the LVS System because of the
> variable Database from the MySQL Server? How to sync the Databases from
> the Different Servers?

MySQL in new versions supports replication of databases.
Documentation for this can be found under www.mysql.com

Bye,
Andreas
Re: MySQL Server [ In reply to ]
Manuel Jenne wrote:
>
> Hi,
>
> it is possibli to use a MySQL Server with the LVS System because of the
> variable Database from the MySQL Server? How to sync the Databases from
> the Different Servers?

The HOWTO discusses this problem

http://www.linuxvirtualserver.org/Joseph.Mack/HOWTO/LVS-HOWTO_1.0-10.html#ss10.7

but it sounds like you already understand the problem

Joe

--
Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
contractor to the National Environmental Supercomputer Center,
mailto:mack.joseph@epa.gov ph# 919-541-0007, RTP, NC, USA
Re: MySQL Server [ In reply to ]
raj dutt wrote:
>
> Hi Manuel,
>
> Yes, it is definitely possible.
> Two options that I'd look into would be as follows:
>
> 1. Use a shared file system such as NFS
> so that you won't have any synchronization
> issues.
> 2. Use mySQL's new replication, and either build
> it into your application, or use heartbeat to
> have one database failover.
>
> We've had success with both of these methods.

can you give more details?

in case 1. having a mysqld running on each of
2 realservers, to a single database file has resulted
in corruption

http://www.linuxvirtualserver.org/Joseph.Mack/HOWTO/LVS-HOWTO_1.0-10.html#ss10.7

we haven't heard of anyone getting case 2 to work.
Can you let us know how you did it?

Thanks Joe

--
Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
contractor to the National Environmental Supercomputer Center,
mailto:mack.joseph@epa.gov ph# 919-541-0007, RTP, NC, USA
Re: MySQL Server [ In reply to ]
While I've been scared to try MySQL using Linux NFS because of the poor
locking facilities, I have been successful with the new replication. In
light of this, I'm not completely sure that it's best to use LVS.

A better solution (in my opinion) would be to have one server replicating to
the other. One one server dies, have a failover solution switch over to the
other server. This could be done with human interaction by changing a DNS
entry or perhaps changing an address in a library. This also would be
possible by using MON or FOS or any number of other solutions.

That way you aren't changing the database in two places... I just think
that's safer.

Now if you're trying to load balance the MySQL load then of course you're
going to need to access it in several places.

Oh well... maybe I'm being too cautious.

All the best --
Ted

----- Original Message -----
From: "raj dutt" <raj.l@voxel.net>
To: <lvs-users@LinuxVirtualServer.org>
Sent: Thursday, March 22, 2001 8:05 AM
Subject: Re: MySQL Server


> Hi Manuel,
>
> Yes, it is definitely possible.
> Two options that I'd look into would be as follows:
>
> 1. Use a shared file system such as NFS
> so that you won't have any synchronization
> issues.
>
> 2. Use mySQL's new replication, and either build
> it into your application, or use heartbeat to
> have one database failover.
>
> We've had success with both of these methods.
>
> Hope this helps.
>
> Cheers,
> Raj Dutt
> Voxel dot Net, Inc.
>
> Manuel Jenne wrote:
> >
> > Hi,
> >
> > it is possibli to use a MySQL Server with the LVS System because of the
> > variable Database from the MySQL Server? How to sync the Databases from
> > the Different Servers?
> >
> > Best regards
> >
> > Manuel
> >
> > _______________________________________________
> > LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> > Send requests to lvs-users-request@LinuxVirtualServer.org
> > or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> Send requests to lvs-users-request@LinuxVirtualServer.org
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
>
Re: MySQL Server [ In reply to ]
Joe --

Many people have actually gotten choice 2 to work. That whole new
feature to MySQL was to provide for the opportunity to do choice 2. In fact,
database replication exists in about every major database out there for this
particular reason. MySQL isn't special.

Perhaps the confusion is that choice 2 does not involve LVS at all. The
MySQL service is not load balanced. HOWEVER, it is possible to put some of
your databases on one server and others on another. Replicate each SET of
databases to the OTHER server and only access them from the other server
when needed. (at an application level or at some fail-over level)

We're doing this right now on some of our systems that have nothing to
do with any of our LVS clusters. We're doing it with MySQL as well as
MS-SQL.

All the best --
Ted

----- Original Message -----
From: "Joseph Mack" <mack.joseph@epa.gov>
To: <lvs-users@LinuxVirtualServer.org>
Cc: <raj.l@voxel.net>
Sent: Friday, March 23, 2001 9:43 AM
Subject: Re: MySQL Server


> raj dutt wrote:
> >
> > Hi Manuel,
> >
> > Yes, it is definitely possible.
> > Two options that I'd look into would be as follows:
> >
> > 1. Use a shared file system such as NFS
> > so that you won't have any synchronization
> > issues.
> > 2. Use mySQL's new replication, and either build
> > it into your application, or use heartbeat to
> > have one database failover.
> >
> > We've had success with both of these methods.
>
> can you give more details?
>
> in case 1. having a mysqld running on each of
> 2 realservers, to a single database file has resulted
> in corruption
>
>
http://www.linuxvirtualserver.org/Joseph.Mack/HOWTO/LVS-HOWTO_1.0-10.html#ss
10.7
>
> we haven't heard of anyone getting case 2 to work.
> Can you let us know how you did it?
>
> Thanks Joe
>
> --
> Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
> contractor to the National Environmental Supercomputer Center,
> mailto:mack.joseph@epa.gov ph# 919-541-0007, RTP, NC, USA
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> Send requests to lvs-users-request@LinuxVirtualServer.org
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
>
Re: MySQL Server [ In reply to ]
Ted Pavlic wrote:
>

> Perhaps the confusion is that choice 2 does not involve LVS at all. The

ah that explains it.
Thanks

Joe

--
Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
contractor to the National Environmental Supercomputer Center,
mailto:mack.joseph@epa.gov ph# 919-541-0007, RTP, NC, USA
Re: MySQL Server [ In reply to ]
Hey Joe,

> can you give more details?

Sure.

> in case 1. having a mysqld running on each of
> 2 realservers, to a single database file has resulted
> in corruption

Yes, I should've been more specific.

The application we're using it in is for a major car manufacturer, in a
read only (SELECT only, no INSERT, DELETE or UPDATE).

NFS works great for this as there are no locking issues in this
environment.

We take down the site every morning for about a minute at 4AM where a
new dump is run to the database.

(the site is all read only expect for this, since it
allows people to search the inventory of a few hundred
dealerships).

> we haven't heard of anyone getting case 2 to work.
> Can you let us know how you did it?

Sure, I can't see any complications, and we haven't really run into any.
Set up a primary mySQL server replicating to a secondary mySQL server.

Serial heartbeat between the two so that the secondary mySQL server
becomes primary in the event of primary failure (sends the obligitory
gratuitous ARPs and voila).

There's no locking issues since they are two completely seperate
filesystems.

Perhaps a more elegeant method is at the application level. In your
database connection routine, you have a built in failover routine.
Somehting along the lines of the following:

include dbhostnamefile
if able to connect to primary db {
dbhandler = handler from primary db
}
else connect to secondary db {
dbhandler = handler from secondary db
swapdbhostnamefiles // so that primary
// becomes secondary
// and we dont have to
// go through this
}

Cheers,

Raj Dutt
Voxel dot Net, Inc.