LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: MySQL Server

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: MySQL Server
From: raj dutt <raj.l@xxxxxxxxx>
Date: Fri, 23 Mar 2001 15:20:41 -0500
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.


<Prev in Thread] Current Thread [Next in Thread>