简体   繁体   English

跨Docker的Elasticsearch集群

[英]Elasticsearch cluster across docker

How do you deploy ES (Elasticsearch) cluster? 您如何部署ES(Elasticsearch)集群?

I use Docker Swarm + Compose for deploy my systems and I try to deploy ES cluster by .yml: 我使用Docker Swarm + Compose部署系统,并尝试通过.yml部署ES集群:

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. 呼叫请求<ip>:9200/_cat/nodes?v我看到单个实例。 Issue https://github.com/elastic/elasticsearch-docker/issues/91 say that it is bug in Docker and it will be fix. 问题https://github.com/elastic/elasticsearch-docker/issues/91说这是Docker中的错误,它将得到修复。 It is OK, but ES without cluster it is not ES! 可以,但是没有群集的ES不是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. 在Internet中,我看到人们将不同的服务作为主服务器和从服务器进行部署,但这是笨拙的解决方案,因为ES本身确定谁是主服务器,谁不是主服务器,因此胜任。 And interesting question: how do you deploy your ES cluster? 一个有趣的问题:如何部署ES集群?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM