Nomploy Nomad Packs

← All packs

solr v0.1.0

Search

Apache Solr — a fast, feature-rich open-source search platform built on Lucene, with full-text search, faceting, highlighting and a web admin UI. Deployed as a single host-networked Nomad service.

nomad-pack run solr --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- solr

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 8983 1 volume image solr:9 pinned :9 image bumped today
Variables 8
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run solr -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "solr"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Apache Solr container image. Pin a tag in production.
image = "solr:9"

# Host port for the Solr server / admin UI.
port = 8983

# Named volume for Solr data and cores (/var/solr).
data_volume = "solr_data"

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 1000
    memory = 1024
  }
NameTypeDefaultDescription
job_name string
"solr"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"solr:9"
The Apache Solr container image. Pin a tag in production.
port number
8983
Host port for the Solr server / admin UI.
data_volume string
"solr_data"
Named volume for Solr data and cores (/var/solr).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 1000
    memory = 1024
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: solr_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/solr_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/solr_data/_data backup:<bucket>/solr_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.

Readme

solr

Apache Solr is a fast, mature open-source search platform built on Apache Lucene. It powers full-text search, hit highlighting, faceted navigation, geospatial search, clustering and rich-document indexing, all administered through a clean web UI and a comprehensive REST API.

This pack runs a single Solr server as a host-networked Nomad service.

Deploy

nomad-pack run solr --registry=nomploy

Open http://<node-ip>:8983/solr/. Create your first core from the UI or:

curl "http://<node-ip>:8983/solr/admin/cores?action=CREATE&name=mycore&configSet=_default"

Configuration

Variable Default Description
image solr:9 Container image (pin a tag in production).
port 8983 Host port for the server / admin UI.
data_volume solr_data Volume for cores and index data (/var/solr).
resources 1000 MHz / 1024 MB CPU and memory for the task.

Cores and index data persist in data_volume. For heavy indexing, raise the memory and consider setting the Solr heap via SOLR_HEAP.