Elastic Entreprise Search 7.9.0 with docker

Viewed 983

I am trying to run Elastic Enterprise search 7.9.0 using the docker image by following the stpeps here : https://www.elastic.co/guide/en/enterprise-search/current/docker.html

docker run -p 3002:3002 -e elasticsearch.host='http://elastic:changeme@host.docker.internal:9200' -e elasticsearch.username=elastic -e elasticsearch.password=changeme -e allow_es_settings_modification=true -e secret_management.encryption_keys='[xxxxxxx]' docker.elastic.co/enterprise-search/enterprise- search:7.9.0

I get the following warning and the service doesn't start :

Found java executable in PATH
Java version detected: 1.8.0_252 (major version: 8)
Enterprise Search is starting...
[2020-09-01T12:10:12.887+00:00][1][2000][app-server][INFO]: Enterprise Search version=7.9.0, JRuby version=9.2.9.0, Ruby version=2.5.7, Rails version=4.2.11.3
[2020-09-01T12:10:13.251+00:00][1][2000][app-server][INFO]: Successfully connected to Elasticsearch
[2020-09-01T12:10:25.949+00:00][1][2000][app-server][INFO]: [db_lock] [installation] Status: [Starting] Ensuring migrations tracking index exists
[2020-09-01T12:10:26.083+00:00][1][2000][app-server][INFO]: [db_lock] [installation] Status: [Finished] Ensuring migrations tracking index exists
[2020-09-01T12:10:26.981+00:00][1][2000][app-server][ERROR]:
--------------------------------------------------------------------------------

We need to perform 11/32 migrations before the service can be started.
Migrations pending: 20200604175830, 20200610113647, 20200611093100, 20200612155336, 20200617164710, 20200617210501, 20200623134305, 20200624153999, 20200709120000, 20200717204953, 20200723200724

Proceeding with migrations while indices are allowing writes can have unintended consequences.
Please enable read-only mode before proceeding:
    https://www.elastic.co/guide/en/enterprise-search/current/read-only-mode.html

I don't know how to resolve this, as I can't set the read-only mode as the service is not starting. Any idea ?

2 Answers

I'm not sure if this is the best solution, but here is what worked for me. Based on https://www.elastic.co/guide/en/enterprise-search/current/read-only-mode.html

  1. Start Docker container with --enable-read-only-mode where it will run and then stop saying read only mode is enabled
  2. Run the Docker container without --enable-read-only-mode until it successfully starts up and runs. Once successfully running I stopped the docker container
  3. Started Docker container with --disable-read-only-mode where it will run and then stop saying read only mode is disabled
  4. Run the docker container as you had previously, no issues

Using your docker command for example:

  1. docker run -p 3002:3002 -e elasticsearch.host='http://elastic:changeme@host.docker.internal:9200' -e elasticsearch.username=elastic -e elasticsearch.password=changeme -e allow_es_settings_modification=true -e secret_management.encryption_keys='[xxxxxxx]' docker.elastic.co/enterprise-search/enterprise- search:7.9.1 --enable-read-only-mode
  2. docker run -p 3002:3002 -e elasticsearch.host='http://elastic:changeme@host.docker.internal:9200' -e elasticsearch.username=elastic -e elasticsearch.password=changeme -e allow_es_settings_modification=true -e secret_management.encryption_keys='[xxxxxxx]' docker.elastic.co/enterprise-search/enterprise- search:7.9.1
  3. docker run -p 3002:3002 -e elasticsearch.host='http://elastic:changeme@host.docker.internal:9200' -e elasticsearch.username=elastic -e elasticsearch.password=changeme -e allow_es_settings_modification=true -e secret_management.encryption_keys='[xxxxxxx]' docker.elastic.co/enterprise-search/enterprise- search:7.9.1 --disable-read-only-mode
  4. docker run -p 3002:3002 -e elasticsearch.host='http://elastic:changeme@host.docker.internal:9200' -e elasticsearch.username=elastic -e elasticsearch.password=changeme -e allow_es_settings_modification=true -e secret_management.encryption_keys='[xxxxxxx]' docker.elastic.co/enterprise-search/enterprise- search:7.9.1

Back to normal. Good luck!

As response to @Christophvh, using docker-compose, you can enable read-only-mode simply using command, for example:

  enterprise-search:                                                                                                                                                                                                                                                                                                                                                     
    image: docker.elastic.co/enterprise-search/enterprise-search:${ELK_VERSION}
    command: --enable-read-only-mode

You have to follow the same steps as described by @Brandon using the command method.

Related