高可用性のトラブルシューティング
高可用性に関して見つかった問題をトラブルシューティングします。
フェイルオーバーの確認
プライマリで障害が発生すると、セカンダリのいずれかが自動的にプライマリに昇格され、読取り/書込みモードに設定されて、クライアント・アプリケーションに対して再び使用可能になります。データ損失は発生しません。
コマンドライン・クライアントの使用
MySQLクライアントやMySQLシェルなどのコマンドライン・クライアントを使用して、フェイルオーバーが発生したかどうかを確認します。
次のコマンドを実行します:
SELECT * FROM performance_schema.error_log WHERE PRIO IN ('System');
フェイルオーバーが発生した場合は、次のようなレスポンスが返されます:
| date&time |35 | System | MY-013214 | Repl| Plugin group_replication reported:
'Starting group operation local execution: Primary election change' |
| date&time |0| System | MY-011507 | Repl | Plugin group_replication reported:
'A new primary with address UUIDOfPromotedSecondary:3306 was elected.
The new primary will execute all previous group transactions before
allowing writes. Enabling conflict detection until the new primary applies
all relay logs.' |
| date&time |37| System | MY-011566 | Repl | Plugin group_replication reported: |
| date&time |37| System | MY-011510 | Repl | Plugin group_replication reported:
'This server is working as primary member.' |
| date&time |0| System | MY-013213 | Repl | Plugin group_replication reported:
'Configuration operation 'Primary election change' terminated. Primary server
switched to: UUIDOfPromotedSecondary'
トランザクション・サイズ・エラーの解決
MY-011608
やERROR 3100 (HY000)
などのトランザクション・サイズ・エラーを解決します。
このタスクは、高可用性DBシステムでトランザクション・サイズ関連のエラーが発生したことを前提としています:
[ERROR] [MY-011608] [Repl] Plugin group_replication reported: 'Error on session 423. Transaction of size 90386497 exceeds specified limit 85899345. To increase the limit please adjust group_replication_transaction_size_limit option.'
ERROR 3100 (HY000): Error on observer while running replication hook 'before_commit'.
これらのエラーを解決するには、次のいずれかを実行します:
- トランザクション・サイズを縮小します。group_replication_transaction_size_limitを参照してください。
- パラレル・ロード方法を使用します。
- ニーズに合ったシェイプを使用してDBシステムを作成します。DB Systemの作成を参照してください。