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?
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.