###前提・実現したいこと
auroraのクラスターを2台のインスタンスで構成
writer:r3.large(インスンタスA)
reader:t2.medium(インスンタスB)
インスタンスAをr3.large->t2.mediumにスケールダウンを実施。スケールダウンに伴い自動フェイルオーバーが発生。インスタンスBがwriter兼readerに変更。スケールダウン完了後にインスタンスAがreaderとしてクラスターに復帰。
そこでwriterとreaderを元に戻すためAWSのコンソールからマニュアルでフェールオーバーを実施し、インスタンスAがwriterになり、インスタンスBがreaderに切り替わりました。
その後、クラスターのエンドポイントに接続できず、読み込みエンドポイントには接続可能な状態であったためwriter側のインスタンス(インスタンスA)を再起動しましたが回復せず。
最終的にはインスタンスAを削除し、再度レプリカを作って冗長性を回復させましたが、フェイルオーバーが見た目上完了している状態で、実際には接続できない状態になるのは実際の運用上は非常に困ってしまうので、同様な事象に遭遇した方で
- 事前検知する方法(最悪error_logのパースを想定していますが、パターンが分かっていない)
- 発生するパターン
などご存知の方いらっしゃいましたら教えていただきたいと考えています。
###発生している問題・エラーメッセージ
- クラスターのエンドポイントに接続したところ、
Can't connect to MySQL server
とエラーが発生。
- 読み込みエンドポイントに対しては接続可能でした。
- エラーログは以下のような状況でした。07:25:34からのログはインスタンスの再起動後。
2017-06-20 07:00:13 30156 [Warning] You need to use --log-bin to make --log-slave-updates work. 2017-06-20 07:00:13 30156 [Note] Plugin 'FEDERATED' is disabled. 2017-06-20 07:00:13 2b874f346380 InnoDB: Warning: Setting innodb_checksums to OFF is DEPRECATED. This option may be removed in future releases. You should set innodb_checksum_algorithm=NONE instead. 2017-06-20 07:00:13 30156 [Note] InnoDB: The InnoDB memory heap is disabled 2017-06-20 07:00:13 30156 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-06-20 07:00:13 30156 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-06-20 07:00:13 30156 [Note] InnoDB: CPU does not support crc32 instructions 2017-06-20 07:00:13 30156 [Note] InnoDB: Initializing buffer pool, size = 1.5G 2017-06-20 07:00:15 30156 [Note] InnoDB: Completed initialization of buffer pool 2017-06-20 07:00:15 30156 [Note] InnoDB: Highest supported file format is Barracuda. 2017-06-20 07:00:15 30156 [Note] InnoDB: 128 rollback segment(s) are active. 2017-06-20 07:00:15 30156 [Note] InnoDB: Waiting for purge to start 2017-06-20 07:00:16 30156 [Note] InnoDB: 1.2.10 started; log sequence number 0 170620 7:00:16 server_audit: Audit STARTED. 170620 7:00:16 server_audit: Query cache is enabled with the TABLE events. Some table reads can be veiled. 170620 7:00:16 server_audit: server_audit_incl_users set to ''. 170620 7:00:16 server_audit: server_audit_excl_users set to ''. 2017-06-20 07:00:16 30156 [Note] RSA private key file not found: /rdsdbdata/db/private_key.pem. Some authentication plugins will not work. 2017-06-20 07:00:16 30156 [Note] Server hostname (bind-address): '*'; port: 3306 2017-06-20 07:00:16 30156 [Note] IPv6 is available. 2017-06-20 07:00:16 30156 [Note] - '::' resolves to '::'; 2017-06-20 07:00:16 30156 [Note] Server socket created on IP: '::'. 2017-06-20 07:00:16 30156 [Note] Event Scheduler: Loaded 0 events 2017-06-20 07:00:16 30156 [Note] /rdsdbbin/oscar/bin/mysqld: ready for connections. Version: '5.6.10' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL) 2017-06-20 07:25:34 12189 [Warning] You need to use --log-bin to make --log-slave-updates work. 2017-06-20 07:25:34 12189 [Note] Plugin 'FEDERATED' is disabled. 2017-06-20 07:25:34 2b894d572380 InnoDB: Warning: Setting innodb_checksums to OFF is DEPRECATED. This option may be removed in future releases. You should set innodb_checksum_algorithm=NONE instead. 2017-06-20 07:25:34 12189 [Note] InnoDB: The InnoDB memory heap is disabled 2017-06-20 07:25:34 12189 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-06-20 07:25:34 12189 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-06-20 07:25:34 12189 [Note] InnoDB: CPU does not support crc32 instructions 2017-06-20 07:25:34 12189 [Note] InnoDB: Initializing buffer pool, size = 1.5G 2017-06-20 07:25:37 12189 [Note] InnoDB: Completed initialization of buffer pool 2017-06-20 07:25:37 12189 [Note] InnoDB: Highest supported file format is Barracuda. 2017-06-20 07:25:37 12189 [Note] InnoDB: 128 rollback segment(s) are active. 2017-06-20 07:25:37 12189 [Note] InnoDB: Waiting for purge to start 2017-06-20 07:25:37 12189 [Note] InnoDB: 1.2.10 started; log sequence number 0 170620 7:25:37 server_audit: Audit STARTED. 170620 7:25:37 server_audit: Query cache is enabled with the TABLE events. Some table reads can be veiled. 170620 7:25:37 server_audit: server_audit_incl_users set to ''. 170620 7:25:37 server_audit: server_audit_excl_users set to ''. 2017-06-20 07:25:37 12189 [Note] RSA private key file not found: /rdsdbdata/db/private_key.pem. Some authentication plugins will not work. 2017-06-20 07:25:37 12189 [Note] Server hostname (bind-address): '*'; port: 3306 2017-06-20 07:25:37 12189 [Note] IPv6 is available. 2017-06-20 07:25:37 12189 [Note] - '::' resolves to '::'; 2017-06-20 07:25:37 12189 [Note] Server socket created on IP: '::'. 2017-06-20 07:25:37 12189 [Note] Event Scheduler: Loaded 0 events 2017-06-20 07:25:37 12189 [Note] /rdsdbbin/oscar/bin/mysqld: ready for connections. Version: '5.6.10' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
###試したこと
- コンソール上ではフェールオーバーが完了しステータス上では「利用可能」と表示されていることを確認。
- クラスターエンドポイントに対してnslookupを行いcnameがwriterのインスタンスに切り替わっていることを確認
###補足情報(言語/FW/ツール等のバージョンなど)
エンジン:Aurora(MySQL-Compatible) 5.6.10a
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/06/23 02:03