障害前の状態
1ノード障害
障害対象ノード:リーダーノード(172.16.20.15)
1.リーダーノードを強制停止
数分後にクラスターIPへ再接続可能となり、以下のようにリーダーノードが変更されていることが確認できる
2.停止ノード(172.16.20.15)を削除
3.新規ノード(172.16.20.18)をデプロイ
アクセスできることを確認
4.クラスターのノードIPを変更
Processingへ変更されることを確認
数分待つと、以下のように正常状態となる
2ノード障害
障害対象ノード:リーダーノード(172.16.20.16)、フォロワーノード(172.16.20.18)
1.対象ノードを強制停止
クラスターIPにも、RIP(172.16.20.17)にもGUIアクセスができない
フォロワーの2ノードを停止した場合も同じ挙動となる
→以下リンクにて2ノード停止時は稼働しないとの記載あり
High Availability for Avi Controllers
その場合、正常に稼働するコントローラーノードをシングルノードクラスターに変換することでアクセス可能になる
2.シングルノードクラスターへの変換
admin@172-16-20-17:~$ sudo /opt/avi/scripts/recover_cluster.py
[sudo] password for admin:
This script will remove Cluster configuration and make this Controller a standalone node. Use this script ONLY if the other Controllers are POWERED OFF or not accessible.
WARNING: Please make sure other Controllers in this cluster are either POWERED OFF, DELETED or DISCONNECTED from the network.
Would you like to continue? (Enter yes or no): yes
~~省略~~
The controller services on this VM are now starting; the controller should be ready in a minute or two...
3.障害ノードを削除
4.2ノードを新規デプロイ
5.クラスター構成
以下リンクのようにクラスターIPとフォロワーノードを設定
【Avi】コントローラークラスターの構成 - いんふらブログ
正常に構成されたことを確認
※または障害状況により、もしアクセスできる場合は以下にて対応可能か
1.クラスターIPとフォロワーノードを削除してSAVE
172.16.20.17にてクラスターIPや自分以外のノードが表示されないことを確認
2.停止ノードを削除
3.2ノード(172.16.20.15,172.16.20.16)を新規デプロイ
4.クラスター構成
3ノード障害
1.3ノードを削除
2.3ノードを新規デプロイ
3.リーダーノードにて、ログインできるようにアカウント作成のみを実施
※障害時にリーダーノードであったノードで行う必要はなく、リーダーノードとしたいノードで行えば問題ない
4.リーダーノードへバックアップjsonを配置
5.①.リーダーノードのみ復旧させる場合
admin@172-16-20-17:/tmp$ sudo /opt/avi/scripts/restore_config.py --config avi_conf.json --passphrase VMware1! --do_no
t_form_cluster DO_NOT_FORM_CLUSTER --flushdb
[sudo] password for admin:
Restoring config will duplicate the environment of the config. If the environment is active elsewhere there will be conflicts.
Please confirm if you still want to continue (yes/no)yes
Restoring config as the consent was given.
Tue Oct 31 08:05:46 2023 cmd: /opt/avi/python/bin/portal/manage.py import_configuration --file avi_conf.json --passphrase VMware1! --check-passphrase
Tue Oct 31 08:05:50 2023 cmd: python3 /opt/avi/python/bin/upgrade/config_migrator.py --config-file /tmp/avi_conf.json.updt --output-file /tmp/avi_conf.json.mig
======== Starting Import Configuration ========
Tue Oct 31 08:06:00 2023 Stopping process supervisor
~~省略~~
======== Configuration Restored for 1-node cluster ========
正常に復旧したことを確認
初回デプロイ時と同様の手順にてクラスタを作成することで復旧完了
5-②.3ノードのクラスタ復旧まで実施する場合
admin@172-16-20-17:/tmp$ sudo /opt/avi/scripts/restore_config.py --config avi_conf.json --passphrase VMware1! --flushdb --vip 172.16.20.14 --followers 172.16.20.15 172.16.20.16
[sudo] password for admin:
Restoring config will duplicate the environment of the config. If the environment is active elsewhere there will be conflicts.
Please confirm if you still want to continue (yes/no)yes
Restoring config as the consent was given.
Tue Oct 31 08:22:20 2023 cmd: /opt/avi/python/bin/portal/manage.py import_configuration --file avi_conf.json --passphrase VMware1! --check-passphrase
Tue Oct 31 08:22:24 2023 cmd: python3 /opt/avi/python/bin/upgrade/config_migrator.py --config-file /tmp/avi_conf.json.updt --output-file /tmp/avi_conf.json.mig
======== Starting Import Configuration ========
Tue Oct 31 08:22:35 2023 Stopping process supervisor
~~省略~~
======== Configuration Restored for 3-node cluster ========
正常に復旧したことを確認
・参考資料
Changing Avi Controller Cluster Configuration
Backup and Restore of Avi Vantage Configuration
Recover a Non-Operational Controller Cluster