###前提・実現したいこと
AWS環境にてRDSからEC2内に構築したMySQLサーバにDBテーブルをレプリケーションしたい。
RDS:MySQL5.6
EC2:MySQL5.5
###発生している問題・エラーメッセージ
スレーブ側でchange master to ~の設定を変えた後、START SLAVEしてしばらくすると、
以下の1594エラーが出る。
Last_Errno: 1594 Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
###該当のソースコード
1.RDS側からDBをdumpしてEC2(ローカル)にリストア
$ mysqldump -h [RDSエンドポイント] --databases [DB名] -uroot -p > mysql.dump $ mysql -uroot -p -h localhost [DB名] < mysql.dump
2.RDS側に接続してmasterのステータスを取得
mysql> show master status; +----------------------------+----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set | +----------------------------+----------+--------------+------------------+-------------------+ | mysql-bin-changelog.123456 | 1234 | | | | +----------------------------+----------+--------------+------------------+-------------------+
3.スレーブ側MySQLにログインし以下のコマンドを実行
mysql> change master to MASTER_HOST='(RDSのエンドポイント名)', MASTER_USER='repl', MASTER_PASSWORD='(パスワード)', MASTER_LOG_FILE='mysql-bin-changelog.123456', MASTER_LOG_POS=1234; mysql> START SLAVE;
その後、show slave statusすると上記の1594エラーの表示がされます。
###試したこと
https://qiita.com/kooohei/items/4fdbbfbb7dc3f884577c
こちらのページを参考に各設定を行いました。
■RDS側(パラメータグループの設定)
binlog_format=MIXED
max_allowed_packet=1073741824 (最大値)
■EC2側(my.cnfの設定)
server-id=209
replicate-do-db=(DB名)
binlog_format=MIXED
max_allowed_packet=1073741824
###補足情報(言語/FW/ツール等のバージョンなど)
RDS: MySQL5.6
EC2: MySQL5.5
あなたの回答
tips
プレビュー