Using MySQL built-in replication to optimize usability (vii) _php tutorial

Source: Internet
Author: User
Tags thread stop
Conclusions and observations
First, make sure you get a complete snapshot of the data. If you forget to copy a table or database, it will cause the standby line program to stop. The time to generate a snapshot is critical. You should make sure that the binary log functionality is not valid until you copy the data file. If the binary logging feature is allowed before the snapshot is taken, the thread of the standby may be stopped because the primary key may be repeated when the thread attempts to import important records. The best thing to do is to follow the approach discussed in Part two: Close-copy-allows the binary log function to restart.
You may want to configure replication in the first way, and focus on the standby at the right time to ensure that the standby machine is in sync with the host.
I haven't tested the load-balancing performance of a system that uses replication, but I have the flexibility to use such a system to balance insertions and updates. For example, if the same auto_increment value is given for two records on both servers, which record does the standby thread stop on? Problems like this will cause load balancing to be read-only, a server that handles all the insertions and updates, and a set of standby machines (yes, you can have multiple standby machines separated from the host) to handle all the choices.
I am very happy that MySQL already has some features of the replication system, and the configuration is simple. With it, you can begin to provide additional security measures for out-of-control events.
Translator's words:
As I used to be 3.22 version of MySQL, so in order to test I have to download the 3.23.24 version of the latest program. And because there's only one machine, I just added the binary log settings. However, as this article says, there is a file generation. If you are interested in this, you have to test yourself. In addition, in the latest MySQL user manual, I found this copy function is in 3.23.15, please check the version of MySQL. At the same time, the text about binary log settings is said to be set in the MY.CNF. In the 3.23.24 version that I used, the manual says that there are three files that can be set in the My.ini file under Windows directory, C:MY.CNF and C:MYSQLDATAMY.CNF. When I set "Log-bin" (do not need to set the log parameter first) is the use of the MySQL winmysqladmin software to set up, and in the My.ini set, and the text is different, please test yourself.

http://www.bkjia.com/PHPjc/532385.html www.bkjia.com true http://www.bkjia.com/PHPjc/532385.html techarticle conclusions and comments first, be sure to get a complete snapshot of the data. If you forget to copy a table or database, it will cause the standby line program to stop. The time to generate a snapshot is critical. ...

  • Related Article

    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.