Поисковый сервис

Сервис Solr

Сервис поисковой индексации для приложений с большим объёмом контента, которым нужен полнотекстовый поиск.

Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.

В StackMaster

Как Solr работает в StackMaster

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.

Обзор

Технический профиль Solr

Здесь перечислены версии, которые можно выбрать для Solr в стеке или окружении. Сам сервис публикуется ревизиями, и стек ссылается на конкретную ревизию.

Тип сервиса

Поисковый сервис

Версии

9, 10

Постоянные тома

Data

Стеки

Стеки, в которые входит Solr

Solr входит в эти публичные стеки. Можно создать приложение из публичного стека как есть или добавить сервис в собственный стек.

Конфигурация

Конфигурация сервиса Solr

Сервис Solr объявляет следующее. Если значение можно изменить, его задаёт стек, а каждое окружение может его переопределить.

Технические домены

StackMaster выдаёт каждому публичному HTTP-порту технический домен с TLS-сертификатом и продлевает сертификат. Порт, который сервис помечает как частный, домен не получает. Можно добавить собственные домены.

Тома

Data

Действия

1 действие. Действие — это команда, которую вы запускаете из панели управления или которую StackMaster выполняет после развёртывания или обновления стека.

Связи сервиса

Каждая связь — это подключение Solr к другому сервису. На какой сервис указывает связь, задаёт стек. На карточках перечислены публичные сервисы, которые подходят для каждой связи.

zookeeper

Сервисы, которые подходят для этой связи