【问题标题】:run local instance of elastic search with docker使用 docker 运行弹性搜索的本地实例
【发布时间】:2017-05-23 10:58:13
【问题描述】:

我正在按照这里的说明进行操作https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html 并且只需要一个弹性搜索实例。当我运行docker-compose up 时,我收到一条错误消息The compose file docker-compose.yml is invalid because Unsupported config option for services.volumes: 'esdata1'

我做错了什么?

我的 docker-compose 文件

version: '2.1'
services:
  elasticsearch1:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.4.0
    container_name: elasticsearch1
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 1g
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200

【问题讨论】:

    标签: elasticsearch docker-compose


    【解决方案1】:

    您似乎错过了此处给出的示例文件末尾的顶级 volumes 部分 (https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-cluster-composefile)。

    Docker Compose v2 参考也指定了这个要求 - https://docs.docker.com/compose/compose-file/compose-file-v2/#volumes-volumedriver

    摘自以上链接: For version 2 files, named volumes need to be specified with the top-level volumes key.

    【讨论】:

      猜你喜欢
      • 2016-01-31
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 2019-03-23
      • 2018-07-22
      • 2015-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多