Elasticsearch Cluster Down automatically

Hi Team, I deployed Elasticsearch Cluster on docker with 2 nodes (two containers). everything working well. but due to some technical issues sometimes need to restart the containers at that time master node up and running but data node terminating throwing an error log as this node already part of other node. if execute any command on master node stating that unable to determine the cluster health. here is my configuration of the cluster.

Docker file

FROM elasticsearch:8.8.1
RUN mkdir iqarepo
ENV http.host=0.0.0.0
ENV transport.host=0.0.0.0
ENV cluster.name=docker-cluster
ENV bootstrap.memory_lock=false
ENV path.repo=/usr/share/elasticsearch/iqarepo/
ENV path.logs=/var/log/elasticsearh/
CMD ["elasticsearch"]

docker command:

docker run --name es1 -p 9200:9200 -p 9300:9300 \
  --env http.host=0.0.0.0 \
  --env transport.host=0.0.0.0 \
  --env transport.port=9300 \
  --env http.port=9200 \
  --env ES_JAVA_OPTS="-Xms1g -Xmx1g" \
  --volume /data/es1/:/usr/share/elasticsearch/data \
  --volume /data/logs/:/var/log/elasticsearh/ \
  --volume /data/iqarepo/:/usr/share/elasticsearch/iqarepo/ \
  --env reindex.remote.whitelist='0.0.0.0:9200' \
  --volume /data/config/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties \
  --detach es

docker command for node:

 docker run --name es2 -p 9400:9200 -p 9600:9300 \
  --env http.host=0.0.0.0 \
  --env transport.host=0.0.0.0 \
  --env transport.port=9300 \
  --env http.port=9200 \
  --env ES_JAVA_OPTS="-Xms1g -Xmx1g" \
  --env ENROLLMENT_TOKEN=<token> \
  --volume /data/es2/:/usr/share/elasticsearch/data \
  --volume /data/logs1/:/var/log/elasticsearh/ \
  --volume /data/iqarepo/:/usr/share/elasticsearch/iqarepo/ \
  --detach es

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