콘텐츠로 이동

운영 Runbook

이 document는 Enterprise New offline application을 기준으로 합니다.

  1. deployment package の root directory で다음 commands를 실행합니다.
    Terminal window
    ./bin/verify.sh --site config/site.conf
    ./bin/smoke-business-emqx.sh --site config/site.conf
  2. 다음 항목을 확인합니다.
    • 3 台の Swarm nodes が Ready である。
    • APP VIP /healthz/readyz200 を返す。
    • DB VIP:5432 に접속할 수 있다。
    • PostgreSQL primary、standby、witness topology が정상이다。
    • backendredisemqxsourcefloweventflowmarimoopcua-server が active application node で모두 running 상태이다。
  1. active application node で다음 commands를 실행합니다.

    Terminal window
    cd /opt/tier0-enterprise/tier0-deploy
    bash bin/compose.sh ps
    bash bin/compose.sh logs --tail=200 backend
    curl -fsS http://127.0.0.1:8088/healthz
    curl -fsS http://127.0.0.1:8088/readyz
  2. Health-check の見方:

    • healthz failure: まず backend process、image、container logs 를 확인합니다.
    • readyz failure: DB VIP、Redis、database migration logs も確認します。
    • Home page に到達できるが login できない場合: .envADMIN_INITIAL_PASSWORD を確認し、その後 backend IAM migration logs と user tables 를 확인합니다.HTTP port だけで deployment success を判断하지 마세요.
Terminal window
nc -vz <APP_VIP> 1883
nc -vz <APP_VIP> 8883
nc -vz <APP_VIP> 8083
nc -vz <APP_VIP> 8084
nc -vz <APP_VIP> 4840

Database nodes で次を실행합니다.

Terminal window
systemctl status tier0-postgresql
systemctl status tier0-repmgrd
sudo -iu postgres psql -Atqc 'select pg_is_in_recovery();'
sudo -iu postgres /usr/local/bin/repmgr -f /etc/repmgr.conf cluster show
  • pg_is_in_recovery=false は primary を의미합니다.
  • pg_is_in_recovery=true は standby を의미합니다.
  • DB VIP は current primary のみに配置されている필요합니다.
  • standby replication が interrupted した場合、または witness が upstream errors を報告した場合は、まず site を保全してください。full deployment を直接再実行하지 마세요.
  1. test 前に、現在 VIP を保持している node を記録し、次를 확인합니다.

    Terminal window
    curl -fsS http://<APP_VIP>/healthz
    curl -fsS http://<APP_VIP>/readyz
  2. 現在の VIP node で keepalived を停止した後、別の application node への VIP takeover を確認し、両方の URLs を再テストします。HAProxy backend は active application node の 8088/TCP を指すため、3 台すべての application nodes が active node の port 8088 に到達できる필요합니다.

  3. keepalived を復旧した後、verify.sh と smoke checks を再실행합니다.drill 中に active application containers を停止하지 마세요.

Failure drill の前に backup を作成し、replication が healthy であること를 확인합니다.

Terminal window
./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:

    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
Terminal window
./full-cleanup.sh --env install.env --yes
./install.sh --auto --yes
Terminal window
cd /opt/tier0-enterprise/tier0-deploy
bash bin/compose.sh logs --tail=300 backend
bash bin/compose.sh ps
Terminal window
cd /opt/tier0-enterprise/tier0-deploy
bash bin/compose.sh logs --tail=200 emqx
Terminal window
systemctl status tier0-repmgrd
tail -100 /var/log/repmgr/repmgr.log
sudo -iu postgres psql -Atqc 'show shared_preload_libraries;'
Terminal window
./bin/verify-materials.sh