N
N
netz-sanya2020-06-10 15:44:23
elasticsearch
netz-sanya, 2020-06-10 15:44:23

Why won't ElasticSearch cluster start in Docker Swarm?

version: '3.3'
services:
  es001:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
    environment:
      - node.name=es001
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es002,es003
      - cluster.initial_master_nodes=es001,es002,es003
      - bootstrap.memory_lock=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ports:
      - 9200:9200
    volumes:
      - data01:/usr/share/elasticsearch/data
    networks:
      - elastic
  es002:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
    environment:
      - node.name=es002
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es001,es003
      - cluster.initial_master_nodes=es001,es002,es003
      - bootstrap.memory_lock=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    volumes:
      - data02:/usr/share/elasticsearch/data
    networks:
      - elastic
  es003:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
    environment:
      - node.name=es003
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es001,es002
      - cluster.initial_master_nodes=es001,es002,es003
      - bootstrap.memory_lock=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    volumes:
      - data03:/usr/share/elasticsearch/data
    networks:
      - elastic
volumes:
  data01:
    driver: local
  data02:
    driver: local
  data03:
    driver: local

networks:
  elastic:
    driver: overlay


I run it locally (Everything works, the cluster is going)
docker-compose up

I run it in docker swarm (It doesn’t work, I attached the log of one of the containers)
docker stack deploy -c docker-compose.yml test

Please tell me what is the error

Log of one of the containers:

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question