List:General Discussion« Previous MessageNext Message »
From:Jim Lyons Date:June 22 2009 10:20pm
Subject:Re: Anyone using LVM for backing up?
View as plain text  
What we do to start is the following:

) open 2 windows to the server running the mysql instance
) in one window,
     ) run the mysql cli and issue command 'flush tables with read lock'
     ) stop the slave, if this is a running slave
     ) run either "show master status" or "show slave status", whichever is
appropriate, to get log position
) in the other window
     ) run the "sync" command several times
     ) create the snapshots
) back in the first window
     ) unlock that tables
     ) start the slave, if appropriate
) back in the other window
     ) mount the snapshots


We do it this way to minimize the time the server we're syncing from is in
read lock.

If anyone sees any flaws in this, please let me know.  There's a lot more,
of course, involving rsync and "change master".  I just dealt with the
beginning part.



On Mon, Jun 22, 2009 at 3:41 PM, Little, Timothy <
tlittle@stripped> wrote:

> We have a 20 gig db (that includes the MYIs and MYDs and FRMs).
>
> We are wondering how long LVM snapshots take.. in that how long might
> the DB be read-locked?  Do we have to read-lock it and flush tables?
>
> Are we talking half a second, ten-seconds, 20 minutes?
>
> Currently, when we copy the raw files from one directory to another, it
> takes about 20 mins and brings the DB to it's proverbial knees.  When we
> copy the files with the db server down, it takes 10 minutes or so.
>
> Tim...
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
>
>


-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com

Thread
how to efficiently query for the next in MySQL Community Edition 5.1.34?Mike Spreitzer20 Jun
  • Re: how to efficiently query for the next in MySQL Community Edition5.1.34?Peter Brawley20 Jun
    • Re: how to efficiently query for the next in MySQL Community Edition 5.1.34?Johnny Withers20 Jun
    • Re: how to efficiently query for the next in MySQL Community Edition 5.1.34?Mike Spreitzer20 Jun
      • Re: how to efficiently query for the next in MySQL Community Edition5.1.34?Peter Brawley20 Jun
        • Re: how to efficiently query for the next in MySQL Community Edition 5.1.34?Mike Spreitzer20 Jun
          • Re: how to efficiently query for the next in MySQL Community Edition5.1.34?Peter Brawley20 Jun
            • Re: how to efficiently query for the next in MySQL Community Edition 5.1.34?Mike Spreitzer21 Jun
              • Re: how to efficiently query for the next in MySQL Community Edition5.1.34?Peter Brawley21 Jun
                • Re: how to efficiently query for the next in MySQL Community Edition 5.1.34?Mike Spreitzer21 Jun
        • Anyone using LVM for backing up?Timothy Little22 Jun
          • Re: Anyone using LVM for backing up?Thomas A. McGonagle22 Jun
          • Re: Anyone using LVM for backing up?Jim Lyons23 Jun
          • Re: Anyone using LVM for backing up?David Sparks23 Jun
          • Re: Anyone using LVM for backing up?Baron Schwartz4 Jul