【问题标题】:Elastic Entreprise Search 7.9.0 with docker带有 docker 的 Elastic Enterprise Search 7.9.0
【发布时间】:2020-12-20 13:31:42
【问题描述】:

我正在尝试按照此处的步骤使用 docker 映像运行 Elastic Enterprise search 7.9.0: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- 搜索:7.9.0

我收到以下警告并且服务没有启动:

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

我不知道如何解决这个问题,因为我无法设置只读模式,因为服务没有启动。 有什么想法吗?

【问题讨论】:

    标签: docker elasticsearch


    【解决方案1】:

    我不确定这是否是最佳解决方案,但这对我有用。基于https://www.elastic.co/guide/en/enterprise-search/current/read-only-mode.html

    1. 使用 --enable-read-only-mode 启动 Docker 容器,它将在其中运行,然后停止说只读模式已启用
    2. 在没有 --enable-read-only-mode 的情况下运行 Docker 容器,直到它成功启动并运行。成功运行后,我停止了 docker 容器
    3. 使用 --disable-read-only-mode 启动 Docker 容器,它将在其中运行,然后停止说只读模式已禁用
    4. 像以前一样运行 docker 容器,没有问题

    例如使用你的 docker 命令:

    1. 码头运行 -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. 码头运行 -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. 码头运行 -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. 码头运行 -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

    恢复正常。祝你好运!

    【讨论】:

    • 如何在 docker compose 中做到这一点?
    【解决方案2】:

    作为对@Christophvh 的响应,使用 docker-compose,您可以简单地使用command 启用只读模式,例如:

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

    您必须按照@Brandon 使用命令方法描述的相同步骤。

    【讨论】:

      猜你喜欢
      • 2021-06-16
      • 2021-07-12
      • 2020-11-01
      • 2015-11-28
      • 2016-07-26
      • 1970-01-01
      • 2021-04-20
      • 2021-03-18
      • 1970-01-01
      相关资源
      最近更新 更多