Optimizing availability with MySQL built-in replication (7) _ PHP Tutorial

Source: Internet
Author: User
Tags thread stop
Use MySQL built-in replication to optimize availability (7 ). Conclusion and comments first, we need to confirm that a complete data snapshot is obtained. If you forget to copy a table or database, the backup program will stop. The time when a snapshot is generated is critical. Conclusions and opinions
First, make sure you have obtained a complete data snapshot. If you forget to copy a table or database, the backup program will stop. The time when a snapshot is generated is critical. Make sure that the binary log function is invalid before copying data files. If the binary log function is allowed before the snapshot is obtained, the standby thread may stop because when the thread attempts to import important records, it may stop due to repeated primary keys. It is best to follow the solution discussed in the second part: disable-Copy-enable the binary log function to restart.
You may want to configure the replication process in the first way, and pay attention to the slave at the right time to ensure that the slave and the master are synchronized.
I have never tested the load balancing performance of a system that uses the replication feature, but I will use it flexibly to balance insertion and update. For example, if two records on both servers have the same auto_increment value, in which case will the backup thread stop? A problem like this will allow the server load balancer to be read-only. one server processes all the inserts and updates, and a group of slave servers (yes, you can have multiple slave servers separated from the host) to process all the options.
I am very happy that MySQL already has some features of the replication system, and the configuration is very simple. With it, you can begin to provide additional security measures for uncontrolled events.
Translator's words:
Because I used MySQL 3.22, I had to download the latest version 3.23.24 program to test it. And because there is only one machine, I just added the binary log settings. However, as mentioned in this article, there is indeed a file generation. If you are interested in this, please test it on your own. In addition, in the latest MySQL User Manual, I found that this copy function was available only after version 3.23.15. check your MySQL version. In addition, the setting of binary logs is set in my. cnf. In my version 3.23.24, there are three files in the manual for parameter settings: my. ini file, c: my. cnf and c: mysqldatamy. cnf can be set. When setting "log-bin" (You do not need to set the log parameter first), you can use the WinMySQLadmin software that comes with mysql to set it. the settings in ini are different from those in this article. please test them by yourself.

First, you must confirm that you have obtained a complete data snapshot. If you forget to copy a table or database, the backup program will stop. The time when a snapshot is generated is very critical ....

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.