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