Heim  >  Artikel  >  Datenbank  >  【MySQL案例】HA: GTID

【MySQL案例】HA: GTID

WBOY
WBOYOriginal
2016-06-07 15:19:151250Durchsuche

1.1.1.HA: GTID_MODE配置不一致 【环境描述】 msyql5.6.14 【报错信息】 初始状态Master和Slave都开启了enforce-gtid-consistency和gtid-mode,然后在Master上把它俩都修改成了off关闭状态,这时,Slave发生报错: Last_IO_Error: The slave IO thread stops

1.1.1. HA: GTID_MODE配置不一致

【环境描述】

msyql5.6.14

【报错信息】

初始状态Master和Slave都开启了enforce-gtid-consistency和gtid-mode,然后在Master上把它俩都修改成了off关闭状态,这时,Slave发生报错:

Last_IO_Error: The slave IO thread stopsbecause the master has @@GLOBAL.GTID_MODE OFF and this server has@@GLOBAL.GTID_MODE ON

【报错原因】

MySQL的Master和Slave必须同时开启或者关闭enforce-gtid-consistency和gtid-mode功能,即要保持一致。

【解决方法】

关闭Slave上的enforce-gtid-consistency和gtid-mode功能。

 

【参考资料】

gtid-mode用来设置是否开启GTID功能,如果要开启GTID功能,需要同时开启log-bin和log_slave_updates功能,另外还需要开启enforce_gtid_consistency功能。gtid_mode参数可以设置为on、off、upgrade_step_1、upgrade_step_2四种值,其中upgrade_step_1和upgrade_step_2是给将来mysql可能的新功能预留的,对当前的myql没有任何意义。同时,mysql建议在mysql_upgrade的时候,关闭gtid_mode功能和enforce_gtid_consistency功能,因为Mysql在upgrade期间可能会操作非事务的MyISAM存储引擎表,会引起报错。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn