Operations Runbook
This document is based on the Enterprise New offline application.
Daily Inspection
Section titled “Daily Inspection”- Run the following commands from the deployment package root directory:
Terminal window ./bin/verify.sh --site config/site.conf./bin/smoke-business-emqx.sh --site config/site.conf - Confirm the following items:
- The 3 Swarm nodes are
Ready. APP VIP /healthzand/readyzreturn200.DB VIP:5432is accessible.- The PostgreSQL primary, standby, and witness topology is normal.
backend,redis,emqx,sourceflow,eventflow,marimo, andopcua-serverare all running on the active application node.
- The 3 Swarm nodes are
Application Checks
Section titled “Application Checks”-
Run the following commands on the active application node:
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 interpretation:
healthzfailure: check the backend process, image, and container logs first.readyzfailure: also check DB VIP, Redis, and database migration logs.- Home page reachable but login unavailable: confirm
ADMIN_INITIAL_PASSWORDin.env, then check backend IAM migration logs and user tables. Do not judge deployment success only from the HTTP port.
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”Run the following on 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=falsemeans primary.pg_is_in_recovery=truemeans standby.- DB VIP must only be located on the current primary.
- If standby replication is interrupted or the witness reports upstream errors, preserve the site first. Do not rerun the full deployment directly.
APP VIP Failover
Section titled “APP VIP Failover”-
Before testing, record the node that currently owns the VIP and verify:
Terminal window curl -fsS http://<APP_VIP>/healthzcurl -fsS http://<APP_VIP>/readyz -
After stopping
keepalivedon the current VIP node, confirm VIP takeover on another application node, then retest both URLs. The HAProxy backend points to the active application node on8088/TCP, so all three application nodes must be able to reach port 8088 on the active node. -
After restoring
keepalived, runverify.shand smoke checks again. Do not stop active application containers during the drill.
DB Primary Failure Switchover
Section titled “DB Primary Failure Switchover”Before a failure drill, create a backup and confirm replication is healthy:
./bin/backup-db.sh --site config/site.confAfter stopping tier0-postgresql on the current primary, observe repmgr promoting the standby and DB VIP takeover. The target RTO is within 2 minutes. Historical tests on the same architecture were about 59-64 seconds.
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