運用 Runbook
この document は Enterprise New offline application を前提にしています。
- deployment package の root directory で次の commands を実行します。
Terminal window ./bin/verify.sh --site config/site.conf./bin/smoke-business-emqx.sh --site config/site.conf - 次の項目を確認します。
- 3 台の Swarm nodes が
Readyである。 APP VIP /healthzと/readyzが200を返す。DB VIP:5432にアクセスできる。- PostgreSQL primary、standby、witness topology が正常である。
backend、redis、emqx、sourceflow、eventflow、marimo、opcua-serverが active application node ですべて running である。
- 3 台の Swarm nodes が
Application Checks
Section titled “Application Checks”-
active application node で次の commands を実行します。
Terminal window cd /opt/tier0-enterprise/tier0-deploybash bin/compose.sh psbash bin/compose.sh logs --tail=200 backendcurl -fsS http://127.0.0.1:8088/healthzcurl -fsS http://127.0.0.1:8088/readyz -
Health-check の見方:
healthzfailure: まず backend process、image、container logs を確認します。readyzfailure: DB VIP、Redis、database migration logs も確認します。- Home page に到達できるが login できない場合:
.envのADMIN_INITIAL_PASSWORDを確認し、その後 backend IAM migration logs と user tables を確認します。HTTP port だけで deployment success を判断しないでください。
Protocol Entry Checks
Section titled “Protocol Entry Checks”nc -vz <APP_VIP> 1883nc -vz <APP_VIP> 8883nc -vz <APP_VIP> 8083nc -vz <APP_VIP> 8084nc -vz <APP_VIP> 4840Database Checks
Section titled “Database Checks”Database nodes で次を実行します。
systemctl status tier0-postgresqlsystemctl status tier0-repmgrdsudo -iu postgres psql -Atqc 'select pg_is_in_recovery();'sudo -iu postgres /usr/local/bin/repmgr -f /etc/repmgr.conf cluster showpg_is_in_recovery=falseは primary を意味します。pg_is_in_recovery=trueは standby を意味します。- DB VIP は current primary のみに配置されている必要があります。
- standby replication が interrupted した場合、または witness が upstream errors を報告した場合は、まず site を保全してください。full deployment を直接再実行しないでください。
APP VIP Failover
Section titled “APP VIP Failover”-
test 前に、現在 VIP を保持している node を記録し、次を確認します。
Terminal window curl -fsS http://<APP_VIP>/healthzcurl -fsS http://<APP_VIP>/readyz -
現在の VIP node で
keepalivedを停止した後、別の application node への VIP takeover を確認し、両方の URLs を再テストします。HAProxy backend は active application node の8088/TCPを指すため、3 台すべての application nodes が active node の port 8088 に到達できる必要があります。 -
keepalivedを復旧した後、verify.shと smoke checks を再実行します。drill 中に active application containers を停止しないでください。
DB Primary Failure Switchover
Section titled “DB Primary Failure Switchover”Failure drill の前に backup を作成し、replication が healthy であることを確認します。
./bin/backup-db.sh --site config/site.conf現在の primary で tier0-postgresql を停止した後、repmgr が standby を promote し、DB VIP takeover することを確認します。target RTO は 2 分以内です。同じ architecture での過去の tests は約 59-64 秒でした。
Backup and Restore
Section titled “Backup and Restore”-
Backup:
Terminal window ./bin/backup-db.sh --site config/site.conf -
Restore:
Terminal window ./bin/restore-db.sh --site config/site.conf --restore-file /backup/tier0-db/postgres-YYYYmmddTHHMMSS.dump
Cleanup and Retest
Section titled “Cleanup and Retest”./full-cleanup.sh --env install.env --yes./install.sh --auto --yesCommon Issues
Section titled “Common Issues”Backend Startup Failure
Section titled “Backend Startup Failure”cd /opt/tier0-enterprise/tier0-deploybash bin/compose.sh logs --tail=300 backendbash bin/compose.sh psEMQX Startup Failure
Section titled “EMQX Startup Failure”cd /opt/tier0-enterprise/tier0-deploybash bin/compose.sh logs --tail=200 emqxrepmgrd Repeated Restarts
Section titled “repmgrd Repeated Restarts”systemctl status tier0-repmgrdtail -100 /var/log/repmgr/repmgr.logsudo -iu postgres psql -Atqc 'show shared_preload_libraries;'Material Verification Failure
Section titled “Material Verification Failure”./bin/verify-materials.sh