High Availability (Clustering)

Go-Upkeep uses an Active/Passive architecture to ensure your monitoring never goes down, even if a node fails.

How It Works

  • Leader Node: Performs all monitoring, sends alerts, and hosts the database.
  • Follower Node: Does nothing but check the Leader's health endpoint (/api/health).
  • Failover: If the Leader is unreachable for 15 seconds (3 checks x 5s interval), the Follower promotes itself to Active mode and begins monitoring.
  • Recovery: When the Leader comes back online, the Follower detects it and demotes itself back to Passive mode.
Both nodes must access the same data. Use an external PostgreSQL database or a networked volume for SQLite.

Node 1 (Leader)

docker-compose.yml (leader)yaml
environment:
  - UPKEEP_DB_TYPE=postgres
  - UPKEEP_DB_DSN=postgres://user:pass@db-server:5432/upkeep
  - UPKEEP_CLUSTER_MODE=leader
  - UPKEEP_CLUSTER_SECRET=super-secret-key

Node 2 (Follower)

docker-compose.yml (follower)yaml
environment:
  - UPKEEP_DB_TYPE=postgres
  - UPKEEP_DB_DSN=postgres://user:pass@db-server:5432/upkeep
  - UPKEEP_CLUSTER_MODE=follower
  - UPKEEP_PEER_URL=http://node1-ip:8080
  - UPKEEP_CLUSTER_SECRET=super-secret-key