Failing to setup Elasticsearch dual node cluster

I am trying to run a 2 node Elasticsearch cluster on different ec2 instances present in different regions.
I using the following commands:-

  1. Command to run data node:- sudo docker run -it --pull=always --privileged --net elastic -p 9200:9200 -p 9300:9300 -e discovery.type=zen -e cluster.name=my-elasticsearch-cluster -e node.name=data -e discovery.seed_hosts=54.183.230.27 -e cluster.initial_master_nodes=master -e ES_JAVA_OPTS="-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:7.12.0

  2. Command to run master node:- sudo docker run -it --pull=always --privileged --net elastic -p 9200:9200 -p 9300:9300 -e discovery.type=zen -e cluster.name=my-elasticsearch-cluster -e node.name=master -e discovery.seed_hosts=54.183.230.27 -e cluster.initial_master_nodes=master -e ES_JAVA_OPTS="-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:7.12.0

But the above two are not forming a cluster.
Please help me and let me know what am I doing wrong here.

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