LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: Survey: synchronisation and deployment

To: "lvs-users@xxxxxxxxxxxxxxxxxxxxxx" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Survey: synchronisation and deployment
From: "Matthew S. Crocker" <matthew@xxxxxxxxxxx>
Date: Thu, 15 Aug 2002 11:46:07 -0400 (EDT)
On Thu, 15 Aug 2002, Doug Schasteen wrote:

> What does the keepalived vrrp do exactly? What are you using MySQL for?
> Because if you are running scripts or web programs, then don't you need
> to specify an IP in your connection strings? I'm just wondering how that
> works, because if all your connection strings are set to a certain IP
> and then that IP goes down, how does it know to fail over to the second
> machine? The only thing I can think of is your second machine takes over
> that IP somehow.

keepalived is an awesome tool, bundled with VRRP it allows for machine 
failover. 

Basically you set it up like this.

Machine A:

 Physical IP 192.168.1.10
 MySQL Master
 keepalived Master
  VRRP IP address 192.168.1.20

Machine B:

 Physical IP 192.168.1.11
 MySQL Slave
 keepalived BACKUP
  VRRP IP address 192.168.1.20


The MySQL Master is setup to replicate with the MySQL Slave (192.168.1.20)
The SQL client apps connect to MySQL on 192.168.1.20.  The IP address 
192.168.1.20 will only exist on the machine which keepalived determines to 
be the active MASTER. If something causes that machine to crash or if the 
backup machine stops recieving VRRP announcements from the master it will 
enable the IP address and send out arps for the IP.  The clients will 
connect to the same IP address all the time. That IP address can be on 
either machine.

I use keepalived to fail over my LVS servers but it can be used to 
failover any group of machines.

> I was planning on tackling this issue by writing (rewriting) all of my
> scripts/programs to include one file that does the mysql connections.
> Then I only have to change one file when I want to change where my mysql
> connections go. And then maybe I'll add a failover connection inside of
> that include file, like an "if the first connection didn't work, try the
> backup server". The problem with that is that if for some odd reason the
> first connection doesn't work (perhaps I rebooted the machine), it will
> put them on the backup server and updates will be made to the backup
> server. Any updates made to the backup mysql server while I'm rebooting
> the main mysql server will probably be lost. I can maybe add two-way
> replication for when something like this happens (but not use two-way
> replication all the time, because I've heard that has problems.)

Have the slave server dump transaction logs so you can manually replicate 
the data back over when you recover the master server.


> 
> - Doug
> 
> 
> 
> 
> -----Original Message-----
> From: lvs-users-admin@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:lvs-users-admin@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Ramon Kagan
> Sent: Thursday, August 15, 2002 7:43 AM
> To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: Survey: synchronisation and deployment
> 
> For our MySQL setup I have a single "MySQL" machine.  I setup my MySQL
> to
> listen on the designated port and have setup strict rules in MySQL for
> authentication and access.  (see mysql.user and mysql.db tables).  For
> redundancy I have a second machine running as a replication slave
> against
> the MySQL machine.  I'm using keepalived's vrrp framework to force
> failover when problems arise (hasn't happened yet, knocking on wood
> really hard).  
> 
> 
> 
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
> Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
> 

-- 
----------------------------------------------------------------------
Matthew S. Crocker 
Vice President / Internet Division         Email: matthew@xxxxxxxxxxx
Crocker Communications                     Phone: (413) 587-3350
PO BOX 710                                 Fax:   (413) 587-3352
Greenfield, MA 01302-0710                  http://www.crocker.com
----------------------------------------------------------------------



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