# Failing to setup Elasticsearch dual node cluster

**URL:** <https://discuss.elastic.co/t/failing-to-setup-elasticsearch-dual-node-cluster/334298>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 25, 2023, 9:15am UTC](https://discuss.elastic.co/t/failing-to-setup-elasticsearch-dual-node-cluster/334298 "2023-05-25T09:15:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ANUBHAV\_GUPTA](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@ANUBHAV\_GUPTA](https://discuss.elastic.co/u/ANUBHAV_GUPTA)\
**Post date:** [May 25, 2023, 9:15am UTC](https://discuss.elastic.co/t/failing-to-setup-elasticsearch-dual-node-cluster/334298/1 "2023-05-25T09:15:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 22, 2023, 9:16am UTC](https://discuss.elastic.co/t/failing-to-setup-elasticsearch-dual-node-cluster/334298/2 "2023-06-22T09:16:23Z")

</div>

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