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

Re: Using a development server also as a backup production server



On Fri, May 18, 2007 at 08:34:22PM -0400, Roberto C. Sánchez wrote:
> On Fri, May 18, 2007 at 02:21:50PM -1000, Kar-Hai Chu wrote:
> > 
> > Due to a tight budget, we do not have a live redundant backup to our
> > production server (other than its RAID 1). One thing we *do* have is
> > hard drive space - so we've been trying to setup a process where live
> > production data (mysql, apache) is backup up nightly onto the
> > development machine, so if the production server goes down, we can
> > "flip" the development server into production mode (move development
> > data aside, and symlink to all the backed up production data).
> > 
> I think you want the fake package for the IP switch:
> 
>  Fake is a utility that enables the IP address be taken over by bringing up
>  a second interface on the host machine and using gratuitous arp. Designed
>  to switch in backup servers on a LAN.
> 
> As far as the other stuff, you should probably write a script that does
> everything as it seems there is lots to do.  Doing it manually will very
> likely be error-prone.  Also, you definitely make sure that any
> databases are being dumped properly on the production machine and then
> restored on the testing machine.  That is, simply using something like
> rsync or scp to transfer the on-disk files that contain the database
> cluster is *not* a valid backup stratedy.
> 
> That said, if you have lots of space on the backup server, you might
> want to look into systemimager to create a snapshot of the entire
> production server's filesystem.  Just remember about the proper way to
> get the databases backed up.
> 
> Here is a script I use to backup my postgresql cluster:
> 

I realise the original poster uses MySQL, but if you want to keep a
postgresql DB in sync like that, a great way to do it is by using
PITR/WAL shipping[1]. This will work pretty well if what you're worried
about is hardware failure, and will let you set just how far behind you
want the slave to be.

As far as 'flipping' setups go, have a look at the "heartbeat" or
"heartbeat-2" packages if you want to do something more complex (and
automated). If you've gone that far, ldirectord might also be
interesting to you.

Cheers,

Pasc

[1]: http://www.postgresql.org/docs/8.2/static/warm-standby.html

-- 
Pascal Hakim                                        +61 403 411 672
Do Not Bend



Reply to: