ホームページ > データベース > mysql チュートリアル > Disabling binlog_checksum for MySQL 5.5/5.6 master-master re_MySQL

Disabling binlog_checksum for MySQL 5.5/5.6 master-master re_MySQL

WBOY
リリース: 2016-06-01 13:16:43
オリジナル
1121 人が閲覧しました

Replicating from a newer major version to an older major version in MySQL (for example a 5.6 master and a 5.5 replica) is generally not recommended, but when upgrading a master-master replication topology it’s hard to avoid this scenario entirely. We ended up in this situation last week when upgrading the passive master of an active-passive master-master pair from 5.5 to 5.6. The primary replication flow was going from the active master (5.5) to the passive master (5.6) with no errors, butpt-heartbeatwas running on the passive master, which led to a replication failure with this error on the active master:

Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: ‘Slave can not handle replication events with the checksum that master is configured to log; the first event ‘bin-log.002648’ at 4, the last event read from ‘/var/lib/mysqllogs/bin-log.002648’ at 120, the last byte read from ‘/var/lib/mysqllogs/bin-log.002648’ at 120.’

Why did this happen? Starting in MySQL 5.6.6, the newbinlog_checksumoption defaults toCRC32. Since that option did not exist in MySQL 5.5, the replica can’t handle the checksums coming from the master. Therefore I recommend setting<code>binlog_checksum=NONE</code>in my.cnf as part of the upgrade process for a master-master setup to avoid this error.

My fix was to run this on the passive master:

<code>set global binlog_checksum='NONE';</code>
ログイン後にコピー

Then I added this to my.cnf so it would survive a restart:

<code>binlog_checksum=NONE</code>
ログイン後にコピー

After that change was made I examined the binary log to confirm that it did not include anything other than pt-heartbeat activity, and then executedCHANGE MASTERon the active master to skip the checksummed events.

Once the other master is upgraded I can go back and consider changingbinlog_checksumtoCRC32.

ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート