Тип сервиса
Сервис Solr
Сервис поисковой индексации для приложений с большим объёмом контента, которым нужен полнотекстовый поиск.
Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.
В StackMaster
Как Solr работает в StackMaster
Mode and ZooKeeper
- Solr runs in SolrCloud mode. The
zookeeperlink is required: the manifest passes the linked ZooKeeper service's host asZK_HOST. - Because of that, Solr has collections, not standalone cores. Collection definitions, config sets and
security.jsonare 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:
- When the cluster has no collections, it creates a collection named
defaultfrom Solr's bundled_defaultconfig set, with one shard per ZooKeeper host. - On first initialization it uploads a
security.jsonthat turns on HTTP Basic authentication for all requests, with one administrator account,solr. - 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. Port8983is also the service's main HTTP endpoint (Admin UI and API). - Every request needs HTTP Basic authentication: user
solr, password generated by Wodby (tokenpassword), available asSOLR_CLOUD_PASSWORDinside 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_SERVERandSOLR_CLOUD_PASSWORD). Read them in code; do not store the password in the repository.
Collections and config sets
_defaultis 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 thedefaultcollection 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 withSOLR_CLOUD_PASSWORDby itself. The Collections API and the Admin UI work as well. - The
create,reloadanddeleteactions 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/solrbelong to the image and are replaced with it.
Configuration
SOLR_HEAPsets the JVM heap (image default1024m)./etc/default/solr.in.shis rendered from the environment on every start; never edit it.SOLR_PORTis fixed to8983by the manifest.- Users and permissions are changed through Solr's security API (the image has
update-passwordandadd-admin-useractions), not by replacingsecurity.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
401without credentials is expected once the init action has run.
Обзор
Технический профиль Solr
Версии
Репозиторий исходного кода
Публичный Helm-чарт
Постоянные тома
Конфигурация
Конфигурация сервиса Solr
Технические домены
Тома
Действия
Связи сервиса
Каждая связь — это подключение Solr к другому сервису. На какой сервис указывает связь, задаёт стек. На карточках перечислены публичные сервисы, которые подходят для каждой связи.
zookeeper
Сервисы, которые подходят для этой связи