Using RSYNC with MYSQL and ENSIM

Tony at ServaCorp.com Tony at ServaCorp.com
Mon Mar 28 21:47:56 GMT 2005


I am currently using rsync to transfer MyISAM databases regularly
between several live and backup servers.
15GB total (about 10GB Mysql) and internet speeds sometimes worse than
dialup.

Being unwilling to stop or even slow down production on remote servers:
(and very unwilling to have the remote effectively die when I lose a
connection)

mysqladmin ... flush-tables
rsync		--This one takes a while
mysqladmin ... flush-tables
rsync 	--again. This one goes very fast.
Only bit once (that I know of) with .MYD and .MYI not exactly in sync.

FLUSH TABLES WITH READ LOCK	will guarantee consistency.
Make sure you issue UNLOCK TABLES so that updates can resume.
Anything other than MyISAM tables, likely requires server shutdown to be
viable.

MySQL master and slave works very well for replication,
provided you don't do much messing around back-dooring MySQL.
Slaves tend to die if they might have a problem.
Master tends to survive a lot of abuse.

Depending on available disk space and connectivity,
it may be worthwhile to establish "staging areas".
rsync at LAN speeds followed by rsync at (sometimes bad) internet speeds.
Non-metrizable connectivity. Distance from A to C can be much greater than
the distance from A to B plus the distance from B to C.
With staging areas, as long as I can connect to something than can connect,

Everything from root will catch a few things in /etc and /var at least
that really need to be different on different machines.
rsync everything from root to a staging area on the backup system
can have some interesting advantages. I've used that to clone a running
system.
Be aware that there are some differences between a running system
and a bootable system. A few lock files and PID files may get in the way.

-----Original Message-----
From: rsync-bounces+tony=servacorp.com at lists.samba.org
[mailto:rsync-bounces+tony=servacorp.com at lists.samba.org]On Behalf Of
Clint Byrum
Sent: Monday, March 28, 2005 1:23 PM
To: Carlos Santillana
Cc: rsync at lists.samba.org
Subject: Re: Using RSYNC with MYSQL and ENSIM


On Mon, 2005-03-28 at 13:15 -0600, Carlos Santillana wrote:
> Team,
>
> Im im new on this forum and with RSYNC, i have a Server that im using for
> hosting my own subdomains, using Ensim and MYSQL, but i have another
server
> that o would like to be my backup server.. (FYI: I have 2 License of the
> Ensim)
>
> My questions are:
>
> 1.- Can i use Rsync to backup my primary server to the secondary server?
> MYSQL, ENSIM?
>

I've used rsync to transfer MyISAM databases before, and it works
flawlessly as long as you do something like 'FLUSH TABLES WITH READ
LOCK;' on the master server. For InnoDB... I don't think it should be a
problem, but you will probably have to shut down mysqld to do the rsync.

> 2.- If so how would i do it? Do i just do a whole copy of the server from
> root?
>
> Please advice, and thanks for the help.
>
>
--
Clint Byrum <cbyrum at spamaps.org>

--
To unsubscribe or change options:
https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html



More information about the rsync mailing list