How to start Elasticsearch database from exist volume on docker

I'm trying to install via docker compose in 3 machines on AWS EC2. My compose file is

version: "3.8"
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.12.1
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - bootstrap.memory_lock=true
      - ES_JAVA_OPTS=-Xms${MEM} -Xmx${MEM}
      - network.publish_host=${ES01}
      - index.codec=best_compression
      - xpack.security.enabled=true
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - data01:/usr/share/elasticsearch/data
    extra_hosts:
      - es02:${ES02}
      - es03:${ES03}
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - elastic
  
volumes:
  data01:
    driver: local

networks:
  elastic:
    driver: bridge

It's work well but after stop es03 and es01, es02 still start.
In empty volume the es03 can join cluster but if start es03 with exist volume that got errors.

es03    | {"type": "server", "timestamp": "2021-05-10T06:57:14,442Z", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "es-thaicom-cluster", "node.name": "es03", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
es03    | ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
es03    | bootstrap check failure [1] of [1]: Transport SSL must be enabled if security is enabled on a [basic] license. Please set [xpack.security.transport.ssl.enabled] to [true] or disable security by setting [xpack.security.enabled] to [false]
es03    | ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/es-thaicom-cluster.log
es03    | {"type": "server", "timestamp": "2021-05-10T06:57:14,475Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-thaicom-cluster", "node.name": "es03", "message": "stopping ..." }
es03    | {"type": "server", "timestamp": "2021-05-10T06:57:14,499Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-thaicom-cluster", "node.name": "es03", "message": "stopped" }
es03    | {"type": "server", "timestamp": "2021-05-10T06:57:14,499Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-thaicom-cluster", "node.name": "es03", "message": "closing ..." }
es03    | {"type": "server", "timestamp": "2021-05-10T06:57:14,514Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "es-thaicom-cluster", "node.name": "es03", "message": "closed" }
es03    | {"type": "server", "timestamp": "2021-05-10T06:57:14,516Z", "level": "INFO", "component": "o.e.x.m.p.NativeController", "cluster.name": "es-thaicom-cluster", "node.name": "es03", "message": "Native controller process has stopped - no new native processes can be started" }
es03 exited with code 78

How do I fix it.

I found it's work when disable security packs or enable it with ssl.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.