---
slug: "aws-rds-mysql-replication-failed"
title: "AWS RDS MySQLのレプリケーションが止まったので復旧"
description: "AWS RDS MySQL のレプリケーションが止まったときの復旧手順。MyISAM テーブルがある場合の `CHECK TABLE` 実行と、レプリカ側でのスキップ・再開操作。"
url: "https://www.ytyng.com/blog/aws-rds-mysql-replication-failed"
publish_date: "2017-01-03T12:34:40Z"
created: "2017-01-03T12:34:40Z"
updated: "2026-05-11T13:06:23.719Z"
categories: ["AWS", "MySQL"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/43d02798e6e4479f98d905328c908cfd.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "ja"
---

# AWS RDS MySQLのレプリケーションが止まったので復旧

<div>AWS RDS MySQL のレプリケーションの様子がおかしい</div>
<div></div>
<div>MyIsam テーブルがありますが、</div>
<div>CHECK TABLE xxxx_xxxx;</div>
<div></div>
<div>してみると</div>
<div></div>
<div>Table    Op    Msg_type    Msg_text</div>
<div>xxxx.<span>xxxx_xxxx</span>    check    error    Corrupt</div>
<div></div>
<div><img alt="" height="77" src="/media/uploads/blog/aws/スクリーンショット_2016-09-13_18.34.00.png" width="418"></div>
<div></div>
<div>Msg_text が Corrupt。このテーブルは腐ってると言われます。マスターの方は問題無し。</div>
<div></div>
<div>AWS コンソールの RDS ページを見てみると</div>
<div></div>
<div><img alt="" height="222" src="/media/uploads/blog/aws/スクリーンショット_2016-09-13_18.28.06.png" width="458"></div>
<div></div>
<div></div>
<div>レプリケーションが失敗している</div>
<div></div>
<div>SHOW SLAVE STATUS を見ると</div>
<div></div>
<pre>{<br>    "data":<br>    [<br>        {<br>            "Slave_IO_State": "Waiting for master to send event",<br>            "Master_Host": "10.7.1.169",<br>            "Master_User": "rdsrepladmin",<br>            "Master_Port": 3306,<br>            "Connect_Retry": 60,<br>            "Master_Log_File": "mysql-bin-changelog.131739",<br>            "Read_Master_Log_Pos": 743597,<br>            "Relay_Log_File": "relaylog.000242",<br>            "Relay_Log_Pos": 496325,<br>            "Relay_Master_Log_File": "mysql-bin-changelog.131676",<br>            "Slave_IO_Running": "Yes",<br>            "Slave_SQL_Running": "No",<br>            "Replicate_Do_DB": "",<br>            "Replicate_Ignore_DB": "",<br>            "Replicate_Do_Table": "",<br>            "Replicate_Ignore_Table": "mysql.plugin,mysql.rds_monitor,mysql.rds_sysinfo,mysql.rds_replication_status,mysql.rds_history,innodb_memcache.config_options,innodb_memcache.cache_policies",<br>            "Replicate_Wild_Do_Table": "",<br>            "Replicate_Wild_Ignore_Table": "",<br>            "Last_Errno": 1053,<br>            "Last_Error": "Query partially completed on the master (error on master: 1053) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; . Query: 'UPDATE xxxxx SET xxxxxxxxxxxxxxxxxxx'",<br>            "Skip_Counter": 0,<br>            "Exec_Master_Log_Pos": 496152,<br>            "Relay_Log_Space": 428001772,<br>            "Until_Condition": "None",<br>            "Until_Log_File": "",<br>            "Until_Log_Pos": 0,<br>            "Master_SSL_Allowed": "No",<br>            "Master_SSL_CA_File": "",<br>            "Master_SSL_CA_Path": "",<br>            "Master_SSL_Cert": "",<br>            "Master_SSL_Cipher": "",<br>            "Master_SSL_Key": "",<br>            "Seconds_Behind_Master": null,<br>            "Master_SSL_Verify_Server_Cert": "No",<br>            "Last_IO_Errno": 0,<br>            "Last_IO_Error": "",<br>            "Last_SQL_Errno": 1053,<br>            "Last_SQL_Error": "Query partially completed on the master (error on master: 1053) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; . Query: 'UPDATE xxxxx SET xxxxxxxxxxxxxxxxxxx'",<br>            "Replicate_Ignore_Server_Ids": "",<br>            "Master_Server_Id": 1498488124,<br>            "Master_UUID": "e247ce2a-13ee-11e5-8f81-0adacdd7d587",<br>            "Master_Info_File": "mysql.slave_master_info",<br>            "SQL_Delay": 0,<br>            "SQL_Remaining_Delay": null,<br>            "Slave_SQL_Running_State": "",<br>            "Master_Retry_Count": 86400,<br>            "Master_Bind": "",<br>            "Last_IO_Error_Timestamp": "",<br>            "Last_SQL_Error_Timestamp": "160913 09:37:11",<br>            "Master_SSL_Crl": "",<br>            "Master_SSL_Crlpath": "",<br>            "Retrieved_Gtid_Set": "",<br>            "Executed_Gtid_Set": "",<br>            "Auto_Position": 0<br>        }<br>    ]<br>}</pre>
<div></div>
<div></div>
<div>強制停止したクエリで引っかかっている</div>
<div></div>
<div></div>
<pre>            "Slave_IO_Running": "Yes",<br>            "Slave_SQL_Running": "No",</pre>
<div></div>
<pre>SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;</pre>
<div></div>
<div>→ Access Denied!</div>
<div></div>
<div>復旧できない</div>
<div></div>
<div></div>
<div><a href="http://f-retu.hatenablog.com/entry/2013/11/21/080720" target="_blank">【AWS,RDS,MySQL】RDS(MySQL)のリードレプリカでレプリケーションエラーが出た際の対処 - へろへろもへじ</a></div>
<div></div>
<div>こちらを参考に</div>
<div></div>
<pre>CALL mysql.rds_skip_repl_error;</pre>
<div></div>
<div></div>
<pre>"Slave_IO_Running": "Yes",<br>"Slave_SQL_Running": "Yes",</pre>
<div>なおった</div>
