Search service

Solr service

Search indexing service for content-heavy applications that need full-text search.

You add this service to a stack, where you choose its version and resources. Each app environment can override them.

On Wodby

How Solr runs on Wodby

What Wodby sets up for this Solr service. Check it before creating cores, uploading config sets or changing Solr's authentication.

Mode and ZooKeeper

  • Solr runs in SolrCloud mode. The zookeeper link is required: the manifest passes the linked ZooKeeper service's host as ZK_HOST.
  • Because of that, Solr has collections, not standalone cores. Collection definitions, config sets and security.json are stored in ZooKeeper, not on Solr's volume.
  • Solr protects its znodes in ZooKeeper with digest credentials derived from SOLR_CLOUD_PASSWORD.

What the init action does

After every deployment the manifest runs the init action (make init). It is idempotent:

  1. When the cluster has no collections, it creates a collection named default from Solr's bundled _default config set, with one shard per ZooKeeper host.
  2. On first initialization it uploads a security.json that turns on HTTP Basic authentication for all requests, with one administrator account, solr.
  3. It sets that account's password to the generated one.

It does not touch existing collections.

How applications reach it

  • URL: http://<app service name>:8983/solr. Port 8983 is also the service's main HTTP endpoint (Admin UI and API).
  • Every request needs HTTP Basic authentication: user solr, password generated by Wodby (token password), available as SOLR_CLOUD_PASSWORD inside this container.
  • A service linked to this one receives the host and the password in variables named by the linking service (a Drupal PHP service, for example, gets SOLR_CLOUD_SERVER and SOLR_CLOUD_PASSWORD). Read them in code; do not store the password in the repository.

Collections and config sets

  • _default is a schemaless starting point. An application that needs its own schema uploads its own config set to ZooKeeper and creates a collection from it; do not rely on the default collection for that.
  • The image has an action for a new collection, run in this service's container: make create-collection collection=<name> num_shards=1 config=<config set> -f /usr/local/bin/actions.mk. It authenticates with SOLR_CLOUD_PASSWORD by itself. The Collections API and the Admin UI work as well.
  • The create, reload and delete actions of the image use the core admin API and are meant for standalone mode; in this setup use collections.
  • Do not edit config sets inside the container: the files under /opt/solr belong to the image and are replaced with it.

Configuration

  • SOLR_HEAP sets the JVM heap (image default 1024m). /etc/default/solr.in.sh is rendered from the environment on every start; never edit it.
  • SOLR_PORT is fixed to 8983 by the manifest.
  • Users and permissions are changed through Solr's security API (the image has update-password and add-admin-user actions), not by replacing security.json.

Data

Indexes and logs are in /var/solr on the optional data volume; without it the indexes are lost when the container is replaced. The linked ZooKeeper needs its own volume to keep the collections' configuration. The manifest declares no backups or imports.

Check the result

From this service's container:

  • curl -s -u "solr:$SOLR_CLOUD_PASSWORD" "http://localhost:8983/solr/admin/collections?action=LIST"
  • curl -s -u "solr:$SOLR_CLOUD_PASSWORD" "http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS"
  • A 401 without credentials is expected once the init action has run.

Overview

Technical profile of Solr

The versions are the ones you can select for Solr in a stack or an app environment. The service itself is published in revisions, and a stack references a specific revision.

Service type

Search service

Versions

9, 10

Persistent volumes

Data

Stacks

Stacks that include Solr

These public stacks include Solr. You can create an app from a public stack as it is, or add the service to a stack of your own.

Configuration

Solr service configuration

The Solr service declares the following. Where a value can be changed, a stack sets it and each app environment can override it.

Technical domains

Wodby gives each public HTTP port a technical domain with a TLS certificate and renews the certificate. A port that the service marks private gets no domain. You can add custom domains.

Volumes

Data

Actions

1 action. An action is a command that you run from the dashboard or that Wodby runs after a deployment or a stack upgrade.

Service links

Each link is a connection from Solr to another service. A stack sets which service a link points to. The cards list the public services that can satisfy each link.

zookeeper

Services that can satisfy this link