List:General Discussion« Previous MessageNext Message »
From:Baron Schwartz Date:January 7 2009 3:02pm
Subject:Re: Setup a replication slave without stopping master
View as plain text  
Hi Jed,

> If you are using LVM, you might consider snapshotting, however, doing a live
> snapshot without stopping mysql server would only work if you were copying
> only myisam tables. Mysql-hot-copy would probably be better, but either way,
> you need to flush your tables, which will briefly lock them, so they can get
> onto disk.
>
> In contrast, InnoDB actually needs to "shut down" to cleanly close its table
> structures before you can physically copy the filesystem.

Actually, not true -- an LVM snapshot (or other snapshot) is a great
way to take a backup of InnoDB.  You just need a truly atomic
snapshot, and then you can let InnoDB run its recovery routine on the
snapshot to get back to a consistent state.

> Why do I leave it firewalled? Because once you start writing to an LVM
> volume that's been snapshotted, you start copying disk extents like mad,
> creating a high load condition that can force queries to reach
> connect_timeout.  I have my connect_timeout set pretty low in my
> environment.

That will depend a lot on the workload.

Here are some good links for further reading:

http://www.mysqlperformanceblog.com/2006/08/21/using-lvm-for-mysql-backup-and-replication-setup/
http://www.mysqlperformanceblog.com/2008/06/09/estimating-undo-space-needed-for-lvm-snapshot/


-- 
Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog: http://www.mysqlperformanceblog.com/
Our Services: http://www.percona.com/services.html
Thread
Setup a replication slave without stopping masterClaudio Nanni6 Jan
  • Re: Setup a replication slave without stopping masterJake Maul6 Jan
    • Re: Setup a replication slave without stopping masterBaron Schwartz6 Jan
    • Re: Setup a replication slave without stopping masterClaudio Nanni6 Jan
      • Re: Setup a replication slave without stopping masterJake Maul7 Jan
      • Re: Setup a replication slave without stopping masterBaron Schwartz7 Jan
  • Re: Setup a replication slave without stopping masterJed Reynolds6 Jan
    • Re: Setup a replication slave without stopping masterPaul Choi7 Jan
    • Re: Setup a replication slave without stopping masterBaron Schwartz7 Jan
      • Re: Setup a replication slave without stopping masterJed Reynolds8 Jan
  • RE: Setup a replication slave without stopping masterTheodore Petkantchin7 Jan