Considerations for MySQL failover event

Source: Internet
Author: User
In the master-slave architecture, create an event on the master, as shown below: mysqlshowcreateevent 'insert' \ G; * *************************** 1. row ***************************..

In the master-slave architecture, create an event on the master, as shown below: mysqlshowcreateevent 'insert' \ G; * *************************** 1. row ***************************..

In the master-slave architecture, create an event and virtual host on the master, as shown below:

When slave is synced, the result is as follows. Pay attention to the red font:

Let's look back at the event status and pay attention to the red font:

On the master

On slave

That is to say, the event can only be triggered on the master node, but will not be triggered on the slave node, and the Hong Kong server is rented. Otherwise, if the slave node is triggered, the synchronization replication will break down.

After the master-slave failover, the VIP will drift to the previous slave, and the slave will become a new master.

However, the event status is still "SLAVESIDE_DISABLED", not changed to "ENABLED". In this way, after the switch, the Hong Kong server cannot be executed.

Therefore, you need to manually re-enable the event status.

  • Query OK, 0 rows affected (0.05 sec)

  • Reference manual:

    This article is from the "hechun's technical column" blog. Be sure to keep this source

    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.