0

How do you deploy ES (Elasticsearch) cluster?

I use Docker Swarm + Compose for deploy my systems and I try to deploy ES cluster by .yml:

version: '3.3'  
services:  
  elasticsearch:
    image: elasticsearch:alpine
    ports:
      - '9200:9200'
      - '9300:9300'
    command: [ elasticsearch, -E, network.host=0.0.0.0, -E, discovery.zen.ping.unicast.hosts=elasticsearch, -E, discovery.zen.minimum_master_nodes=1, -E, cluster.name=mycluster ]
    networks:
      - esnet1
    environment:
        ES_JAVA_OPTS: "-Xmx512m -Xms512m"
    deploy:
      mode: replicated
      replicas: 2
      #endpoint_mode: dnsrr
      resources:
        limits:
          cpus: '2'
          memory: 1024M
        reservations:
          cpus: '0.50'
          memory: 512M

networks:
  esnet1:

Call request <ip>:9200/_cat/nodes?v I see single instance. Issue https://github.com/elastic/elasticsearch-docker/issues/91 say that it is bug in Docker and it will be fix. It is OK, but ES without cluster it is not ES! In Internet I saw that guys deploy different service as master and as slave but it is clumsy solution, because The ES itself determines who the master is and who does not, does it competently. And interesting question: how do you deploy your ES cluster?

Lorna Mitchell
  • 1,819
  • 13
  • 22
Ivan Bukharin
  • 321
  • 2
  • 4
  • 22

1 Answers1

0

Answer for this question: https://github.com/elastic/elasticsearch-docker/issues/91#issuecomment-328671018

Use docker 17.09.0-ce-rc1 or later

For example: https://github.com/elastic/elasticsearch-docker/issues/91#issuecomment-330032899

Ivan Bukharin
  • 321
  • 2
  • 4
  • 22