有2个主(A,B)复制和1个具有2个表(TB1,TB2)的数据库。我已将复制配置如下:
大师A
server-id = 1
log_bin = /var/log/mysql/mariadb-bin
log_bin_index = /var/log/mysql/mariadb-bin.index
binlog_do_db = TB1
binlog_format = ROW
slave_run_triggers_for_rbr = YES
replicate_do_table = TB2
relay_log = /var/log/mysql/relay-bin
大师B
server-id = 2
log_bin = /var/log/mysql/mariadb-bin
log_bin_index = /var/log/mysql/mariadb-bin.index
binlog_do_db = TB2
binlog_format = ROW
slave_run_triggers_for_rbr = YES
replicate_do_table = TB1
relay_log = /var/log/mysql/relay-bin
然后在B上触发
CREATE TRIGGER TB1
AFTER UPDATE ON TB1
FOR EACH ROW
BEGIN
UPDATE TB2;
END //
我要运行“在主机A上更新TB1->在主机B上更新TB1->在主机B上更新TB2->在主机A上更新TB2”。但是“在主机B上更新TB2->在主机A上更新TB2”不起作用。此外,我尝试运行“在主机B上更新TB1->在主机B上更新TB2->在主机A上更新TB2”的工作。我该如何解决?