rqlite — a lightweight, distributed relational database built on SQLite with Raft consensus for high availability. Get SQLite's simplicity plus fault-tolerant replication and an easy HTTP API. Deployed as a host-networked single-node Nomad service (join more nodes to form a cluster) with a persistent data volume.
Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.
Source ↗ Project ↗ ★ 17.8k ⚑ Report an issue
Save as values.hcl, edit, then run:
# The name of the Nomad job.
job_name = "rqlite"
# The Nomad namespace to deploy into.
namespace = "default"
# The datacenters to deploy to.
datacenters = ["*"]
# The rqlite container image. Pin a tag in production.
image = "rqlite/rqlite:latest"
# Host port for the HTTP API (-http-addr).
http_port = 4001
# Host port for the Raft consensus protocol (-raft-addr).
raft_port = 4002
# Named volume for rqlite data (/rqlite/file): the SQLite database and Raft log.
data_volume = "rqlite_data"
# Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
# Resources for the rqlite task.
resources = {
cpu = 300
memory = 256
}
| Name | Type | Default | Description |
|---|---|---|---|
| job_name | string | "rqlite" | The name of the Nomad job. |
| namespace | string | "default" | The Nomad namespace to deploy into. |
| datacenters | list | ["*"] | The datacenters to deploy to. |
| image | string | "rqlite/rqlite:latest" | The rqlite container image. Pin a tag in production. |
| http_port | number | 4001 | Host port for the HTTP API (-http-addr). |
| raft_port | number | 4002 | Host port for the Raft consensus protocol (-raft-addr). |
| data_volume | string | "rqlite_data" | Named volume for rqlite data (/rqlite/file): the SQLite database and Raft log. |
| constraints | list | [] | Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true". |
| resources | object | {
cpu = 300
memory = 256
} | Resources for the rqlite task. |
No variables match.
This pack stores data in one Docker named volume:
rqlite_data
restic
# Run on the node hosting this pack. Point restic at your repo first: # export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>" # export RESTIC_PASSWORD="<repo-password>" # export AWS_ACCESS_KEY_ID=<key> AWS_SECRET_ACCESS_KEY=<secret> restic backup \ /var/lib/docker/volumes/rqlite_data/_data
rclone (sync to S3/R2)
rclone sync /var/lib/docker/volumes/rqlite_data/_data backup:<bucket>/rqlite_data
Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.
rqlite — a lightweight, distributed relational database built on SQLite with Raft consensus. You get SQLite's simplicity and a friendly HTTP API, plus fault-tolerant replication across nodes when you want high availability.
Single host-networked node with a persistent data volume (join more nodes to form an HA cluster).
nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run rqlite --registry=nomploy
| Variable | Default | Description |
|---|---|---|
http_port |
4001 |
HTTP API port (-http-addr). |
raft_port |
4002 |
Raft consensus port (-raft-addr). |
data_volume |
rqlite_data |
/rqlite/file — the SQLite database and Raft log. |
image |
rqlite/rqlite:latest |
Container image. Pin a tag in production. |
resources |
{ cpu = 300, memory = 256 } |
Task resources. |
Query over HTTP:
curl -G 'http://<node-ip>:4001/db/query' --data-urlencode 'q=SELECT 1'
This runs a single durable node. For high availability, deploy more instances and -join them to
this node's raft address. The API is unauthenticated — keep it on an internal network or configure auth.
Pin the job to the node holding the volume with constraints.