High Availability and Topologies
NORA has no built-in failover yet. It runs with one writer: one process that writes to the storage at a time. This page lists the topologies that work within that rule, what each one survives, and what is planned. Active/standby with leader election is designed in #796.
Where the state lives
Section titled “Where the state lives”| State | Where | After a restart |
|---|---|---|
| Artifacts, metadata, cache | The storage backend: local disk, S3-compatible storage or Google Cloud Storage | Kept |
| API tokens | auth.token_storage, data/tokens by default, on the local disk with every backend | Kept if the directory is on a persistent volume |
| Curation quarantine ledger | quarantine.jsonl in storage.path, on the local disk | Kept if the directory is on a persistent volume |
| Upload sessions, publish locks, circuit breakers, caches | Process memory | Reset; a docker push cut by the restart is run again |
With S3 or GCS storage the artifacts outlive the host. Keep the local data directory (/data in the container) on a persistent volume as well: with authentication on, a restart without it loses the issued tokens and every client gets 401.
Single instance, restarted on failure (recommended)
Section titled “Single instance, restarted on failure (recommended)”One NORA, restarted by the supervisor when it dies.
- systemd: the shipped unit
dist/nora.servicerestarts NORA on failure (Restart=on-failure,RestartSec=5). - Kubernetes: the Helm chart defaults to one replica, the
Recreatestrategy and a persistent volume for/data. Kubernetes starts a new pod when the old one fails; when the node is lost, the pod comes back once the volume is attached on another node. - Docker:
--restart unless-stoppedand a named volume for/data.
While NORA restarts, builds keep working from the clients’ own caches (the Docker image store, ~/.m2, ~/.npm, ~/.cargo, the pip cache) for everything they already have. Pulls of new artifacts and publishes wait for NORA.
Warm standby on two hosts
Section titled “Warm standby on two hosts”Two hosts with access to the same bucket. NORA runs on one of them; on the other it is installed and stopped. A failover tool (keepalived with VRRP, Pacemaker) moves the service address to the standby host and starts NORA there.
- Keep the standby stopped. A running NORA works on the storage without any requests: the maintenance loop probes it, and the retention scheduler, when enabled, deletes. Two running instances on one bucket are two writers.
- Tokens: put
auth.token_storageon storage both hosts can reach, or copy the directory from the active host to the standby one way, on a schedule. Tokens issued after the last copy are missing after a failover. - Quarantine ledger: the same applies to
quarantine.jsonlif curation quarantine is on. - Kubernetes: do not run a second replica as a standby. It passes its readiness probe, receives traffic and writes. Use one replica until active/standby lands.
Why not several replicas
Section titled “Why not several replicas”Several replicas behind a load balancer are not supported:
- the publish lock that serializes writes to one artifact is per process, so two replicas can write the same path at once;
- a
docker pushis several requests (POST,PATCH,PUT) bound to an upload session kept in memory, so they must reach the same replica; - each replica caches token checks for up to 5 minutes, so a revoked token keeps working on the other replicas for that long.
See also the storage notes in COMPAT.md on conditional writes.
Backups and storage replication
Section titled “Backups and storage replication”nora backupandnora restorewrite and read a full copy of the artifacts.- On S3, bucket versioning and replication by the storage itself protect against a lost bucket or a bad delete. Replicate one way, from the bucket NORA writes to.
- File-level sync (rsync) suits a cold copy taken in one direction. Two hosts that write and sync into each other diverge.
A CDN in front
Section titled “A CDN in front”For geo-distributed reads, put a CDN in front of NORA. Immutable artifacts (Docker blobs, Maven releases, crates, wheels) cache well and stay available while NORA restarts.
Planned: active/standby
Section titled “Planned: active/standby”#796 describes active/standby on a shared bucket, in two steps:
- Conditional writes in the storage layer (
put_if_absent,put_if_match) on S3 and local disk. - A lease object in the bucket. The instance holding the lease serves traffic; the others answer
503on/readyand take the lease over when it expires. The bucket plays the role a database plays in other registries.
Active-active (several writers) is not planned before that.