I wanna run only one elasticsearch service in docker-swarm cluster having multiple replicas or at least one replica of this service in each node of docker-swarm cluster.
Does Elasticsearch have capability to form ES cluster with only one ES docker service running multiple replicas of it in Docker-Swarm. Below is my elasticsearch.yml config and docker-compose.yml files
Is it possible or not . If yes what tweaking needs to be done in elasticsearch.yml file to get desired results.
yes it is possible to achieve it.
just add endpoint_mode as dnsrr like below in docker-compose.yaml file.
for deploying one instance/container across all docker-swarm nodes use "mode: global" in docker-compose.yaml file.
For deploying all ES cluster instance/containers in one machine, use "mode: replicated" and specify replicas to deploy as say "replicas: 3" in docker-compose.yaml file.
With usage of "endpoint_mode: dnsrr" we won't able to expose service ports.
For this purpose we should use an external load balancer like nginx or haproxy.
Like below nginx docker-compose.yaml file
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.