Research on accelerating binlog back-shift

Source: Internet
Author: User

The current background is 1 of the business, full backup +binlog (200, each 256M) to restore to a point in time, where the full backup 5 minutes, Binlog originally may take 20 hours, this time is too long, what is the optimization program fast recovery speed?

Solution:

If the binary logs that need to be restored are more complex, it is highly recommended that you use MySQL's own replication to restore binloginstead of using mysqlbinlog

programme I, Span style= "Color:rgb (51,51,51); Font-size:14px;font-family:arial;background:rgb (255,255,255);" > binlog copy to relay log directory, and modify slave-info related files, let binlog as relay log to execute

1) Close the current instance

2) Copy the binlog to the corresponding relay log directory (datadir or relay-log The directory specified by the parameter )

3) Open the relay-log.info file specified by the relay-log-info-file parameter (datadir under Directory Span style= "font-family: ' Courier New ';" >relay-log.info file ) relay log relay log The location of the file

4)   Open relay-log-index file " Span style= "font-family: ' Courier New ';" > ( --relay-log-index host_ Name-relay-bin.index) will need to be restored binlog

5) start the database and start slave SQL _thread

Scenario Two "is actuallyFelixthe hot spareDRthe improved version "for the instance that needs to be recovered from, the instance that needs to be restored isDB, restore the full standby toDRon,DBon theBinlogCopy toDRabove (the specific action is the above scenario one2,3,4, or you can not do it, simply doDRYes, but it still needs to be used.I/othreadlogging back to the trunk log is slow,or human synchronization relay log is better, but this is a theoretical operation, I have not practiced, there may be key operating points can not grasp ), then DR on change master to the binlog location that needs to be recovered using SQL Thread to recover data that requires DB recovery on DR .

Note the point:

* recommended in config file plus Skip-slave-start to prevent slave threads from starting to execute themselves when they don't need to.

* When start slave , you can control where slave is executed by start slave until .

* Slave execution of the real site, the relay-log.info or change master to specify


Research on accelerating binlog back-shift

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.