Related files for MySQL replication

Source: Internet
Author: User

1.master.info file

Located at the slave end of the data directory, storage slave connected to master information, such as the master host address, connection user, password, port, the log information has been obtained.

The Master.info file is modified and deleted during the copy process, and replication is not interrupted. If stop slave, then start slave, can start up normally, because MySQL has memorized the information, but when restarting MySQL, at start slave, when the restart fails, it will prompt you change master to

2.relay Log

The Mysql-relay-bin.xxxxxn file is used to hold the binary log information read from the master side of the I/O thread on the slave side, and then the SQL thread from the slave side reads and parses the corresponding log information from the relay log. Into the SQL statement executed by master and then applied on the slave side.

3.relay-log.info file

Similar to Master.info, stores information about the relay log that is written to the local slave I/O thread. SQL threads for the slave end and some administrative operations are ready to get information about the current replication.

The general situation after the master-slave switch, need to reset slave, clear relay-log.info.

4.mysql-bin.index

Record binary log files on disk. MySQL relies on this file, unless there is a record in this file, otherwise MySQL cannot identify the binary log file.

5.mysql-relay-bin-index

Index file for the trunk log

Master.info and Relay_log.info are still used by default in 5.6. A new feature is also introduced: Crash-safe slave, which can write replication information to a table in the MySQL database.

(1) When the variable master-info-repository is set to file, the Master.info file is used, and when set to table, the master information is written to the Mysql.slave_master_info table.

(2) When the variable relay-log-info-repository is set to file, the Relay-log.info file is used, and when set to table, the information is written to the Mysql.slave_relay_log_info table.

Both tables are MyISAM engine tables, which are recommended to modify the InnoDB engine table:

mysql> Stop slave;mysql> ALTER TABLE mysql.slave_master_info engine=innodb;mysql> ALTER TABLE mysql.slave_ Relay_log_info engine=innodb;mysql> start slave;

Related files for MySQL replication

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.