List:General Discussion« Previous MessageNext Message »
From:Jacob Friis Larsen Date:May 13 2004 10:16pm
Subject:Re: Restore 20 gigabytes of binary logfiles
View as plain text  
>> I need to restore 20 gigabytes of binary logfiles.
>> What should I do in order to get the job done as quickly as possible?
> 
> There is a faster way, but it is rather tricky.
> 
> 4.0 slave can be tricked into thinking that those binary logs are in 
> fact the relay logs that it gathered from the master. So we trick the 
> server into thinking it is a slave of the server that produced them. You 
> just need to pick a server-id that is not the same as the one that 
> produced them. Then if you list the logs in in the relay log info file 
> in the correct order, hand-craft relay-log.info file to point at the 
> first one), then start the slave with skip-slave-start, and then just 
> start the SQL thread manually (SLAVE START SQL_THREAD), it will process 
> them until it is done. Periodically run SHOW SLAVE STATUS to see if it 
> got to the end of the last log.

How should relay-log.info look like?
Like this:

linuxweb1-bin.001
linuxweb1-bin.002
linuxweb1-bin.003
...
Thread
Restore 20 gigabytes of binary logfilesJFL12 May
  • Re: Restore 20 gigabytes of binary logfilesSasha Pachev13 May
    • Re: Restore 20 gigabytes of binary logfilesJFL13 May
      • Re: Restore 20 gigabytes of binary logfilesJeremy Zawodny13 May
    • Re: Restore 20 gigabytes of binary logfilesJacob Friis Larsen13 May
      • Re: Restore 20 gigabytes of binary logfilesJeremy Zawodny13 May