Deployment guide

Apache Solr 9

Overview

Apache Solr is an open-source search platform built on Apache Lucene. It provides full-text search, faceted navigation, rich document indexing, vector kNN retrieval, and Solr Streaming Expressions for analytics over indexed data.

The SecureAnyCloud image installs Solr 9.10.1 (last 9.x LTS line, Lucene 9 underneath) from the official Apache CDN with SHA-512 verification, alongside OpenJDK 17. BasicAuthPlugin protects the Solr Admin UI and REST API with a per-VM SecureAnyCloud admin password that is rotated at first boot. A SecureAnyCloud core is pre-created from the bundled _default configset, so the server is queryable as soon as you log in.

What you get:

  • Apache Solr 9.10.1 (Lucene 9) at /opt/solr (symlinked to /opt/solr-9.10.1)
  • OpenJDK 17 JRE headless from Ubuntu 24.04 noble main
  • Standalone mode (no SolrCloud, no external ZooKeeper), suitable for development, testing, single-tenant production search and embedded application search
  • solr.service running as the unprivileged solr service user
  • BasicAuthPlugin and RuleBasedAuthorizationPlugin enabled out of the box
  • A pre-created SecureAnyCloud core under /var/solr/data/sac
  • A per-VM SecureAnyCloud password generated at first boot (32 hex characters, stored as a double-SHA-256 digest with salt in security.json), with a plain copy in /stage/scripts/solr-credentials.log
  • 24/7 SecureAnyCloud support

Prerequisites

  • An active Azure subscription
  • An SSH key
  • A VNet and subnet
  • A network security group (NSG) that allows inbound 22/tcp from your management CIDR and 8983/tcp from any client CIDR that needs the Solr Admin UI or REST API

Standard_B2s (4 GB RAM, 1024m heap default) suits development, testing, single-tenant production search and embedded application search. For larger indexes, move up to D4s or D8s and tune SOLR_HEAP in /etc/default/solr.in.sh.

Step 1-3: Deploy and connect over SSH

ssh azureuser@<vm-ip>
4

Check the service status and version

sudo systemctl is-active solr.service solr-firstboot.service /opt/solr/bin/solr version
5

Test authentication and read system info

PASS=$(sudo grep '^SOLR_ADMIN_PASSWORD=' /stage/scripts/solr-credentials.log | cut -d= -f2-)
curl -s -o /dev/null -w 'no-auth: HTTP %{http_code}\n' http://127.0.0.1:8983/solr/admin/info/system
curl -sf -u "sac:${PASS}" 'http://127.0.0.1:8983/solr/admin/info/system?wt=json' | head -c 400

The first call returns 401, because BasicAuthPlugin rejects unauthenticated requests. The second returns the cluster system info JSON, including solr-spec-version, JVM and host details.

6

Read your per-VM credentials

sudo cat /stage/scripts/solr-credentials.log

Note the values of SOLR_ADMIN_URL, SOLR_ADMIN_USER and SOLR_ADMIN_PASSWORD. The password is a fresh 32-character hex string, so no two VMs share credentials.

7

Open the Solr Admin UI dashboard

Browse to http://<vm-ip>:8983/solr/ and sign in as SecureAnyCloud. The Dashboard shows the Solr instance, JVM memory, file descriptors and index size at a glance.

8

Select the SecureAnyCloud core

Choose SecureAnyCloud in the Core Selector. The core overview lists the schema, statistics and the query interface. Click Query to send a *:* query against the empty core. You get numFound: 0 until you index documents.

9

Use the query interface

The Query tab lets you build queries against the SecureAnyCloud core. The left-hand controls cover q=*:*, sorting, faceting, highlighting and JSON Request API examples.

10

Index a document with the JSON Request API

PASS=$(sudo grep '^SOLR_ADMIN_PASSWORD=' /stage/scripts/solr-credentials.log | cut -d= -f2-)
curl -sf -u "sac:${PASS}" -H 'Content-Type: application/json' \
  -d '[{"id":"1","title_t":"hello sac","body_txt":"Solr 9 first document"}]' \
  'http://127.0.0.1:8983/solr/sac/update?commit=true'
curl -sf -u "sac:${PASS}" 'http://127.0.0.1:8983/solr/sac/select?q=*:*&wt=json' | head -c 400

The first call indexes a single document and commits it. The second returns the document under response.docs.

11

Create a new core

sudo -u solr /opt/solr/bin/solr create -c products -d _default

The solr create CLI clones the bundled _default configset and registers a new products core under /var/solr/data/products. The Admin UI Core Selector picks it up immediately.

12

Tune the heap and JVM

Edit /etc/default/solr.in.sh, then restart Solr:

sudo systemctl restart solr.service

Defaults on Standard_B2s:

  • SOLR_HEAP: 1024m
  • SOLR_JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
  • SOLR_HOME: /var/solr/data
  • SOLR_PORT: 8983

For production, raise SOLR_HEAP to 4096m or higher on D4s or D8s instances.

13

Add a second user

Replace <new-password> with the password you choose for the new user:

PASS=$(sudo grep '^SOLR_ADMIN_PASSWORD=' /stage/scripts/solr-credentials.log | cut -d= -f2-)
curl -sf -u "sac:${PASS}" -H 'Content-Type: application/json' \
  -d '{"set-user":{"alice":"<new-password>"}}' \
  'http://127.0.0.1:8983/solr/admin/authentication'
curl -sf -u "sac:${PASS}" -H 'Content-Type: application/json' \
  -d '{"set-user-role":{"alice":["admin"]}}' \
  'http://127.0.0.1:8983/solr/admin/authorization'
14

Back up your indexes

Solr's snapshot API takes a point-in-time copy of an index without downtime:

PASS=$(sudo grep '^SOLR_ADMIN_PASSWORD=' /stage/scripts/solr-credentials.log | cut -d= -f2-) sudo -u solr install -d -m 0755 /var/solr/backups curl -sf -u "sac:${PASS}" \
  "http://127.0.0.1:8983/solr/sac/replication?command=backup&location=/var/solr/backups&name=demo"

Copy /var/solr/backups to Azure Blob Storage (az storage blob upload-batch) on a regular schedule for off-VM retention.

15

Read logs and troubleshoot

sudo journalctl -u solr.service --no-pager -n 80
sudo journalctl -u solr-firstboot.service --no-pager -n 30
sudo tail -50 /var/solr/logs/solr.log 2>/dev/null

Solr writes its main log to /var/solr/logs/solr.log, its request log to /var/solr/logs/<date>.request.log and its slow-query log to /var/solr/logs/solr_slow_requests.log. The systemd journal captures stdout from the first-boot script.

Security

  • BasicAuthPlugin enforces authentication on every endpoint under /solr/
  • /var/solr/data/security.json is 0640 solr:solr and stores double-SHA-256 password digests with salt
  • Credentials are generated per VM at first boot, so no secrets are shared between deployments
  • Restrict NSG inbound on :8983 to the IP ranges that need the Solr Admin UI or REST API
  • For production HTTPS, enable Solr's own SSL (jetty-ssl.xml, truststore and keystore), or terminate TLS at an upstream Application Gateway or Front Door

Support

SecureAnyCloud provides 24/7/365 expert technical support. Response is guaranteed within 24 hours, with a one-hour average for critical issues. Contact sales@secureanycloud.com.

Deploy on Azure

Launch Apache Solr 9.10 on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure