# Setting up 2 nodes on same machine

**URL:** <https://discuss.elastic.co/t/setting-up-2-nodes-on-same-machine/166858>\
**Category:** Elasticsearch\
**Created:** [February 3, 2019, 9:19am UTC](https://discuss.elastic.co/t/setting-up-2-nodes-on-same-machine/166858 "2019-02-03T09:19:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Filip\_Pavlic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filip_pavlic/32/27530_2.png) [@Filip\_Pavlic](https://discuss.elastic.co/u/Filip_Pavlic)\
**Post date:** [February 3, 2019, 9:19am UTC](https://discuss.elastic.co/t/setting-up-2-nodes-on-same-machine/166858/1 "2019-02-03T09:19:58Z")

</div>

Hi,

I have read all that I could find about setting up two nodes, searched entire internet but I'm failing to set two nodes in same cluster on dev machine (test enviroment). What did I miss ?

I have 2 elastic installation folders pointing to different data/log folders, so they should act like two different nodes using two different IP's but same ports. (ip in example are dummy).

Node ports are allowed in firewall, I have access to them and running Kibana to check if node 2 connected to same cluster..but failing. Please help.

**node 1 settings:**  
cluster.name: "Cluster-1"  
node.name: "Instance-1"  
node.max\_local\_storage\_nodes : 4  
network.host: "192.168.1.1"  
http.port: 9244  
transport.tcp.port: 9245  
discovery.zen.ping.unicast.hosts: ["192.168.1.1:9244", "192.168.1.2:9244"]  
discovery.zen.minimum\_master\_nodes: 1

**Node 2 settings:**  
cluster.name: "Cluster-1"  
node.name: "Instance-2"  
node.max\_local\_storage\_nodes : 4  
network.host: "192.168.1.2"  
http.port: 9244  
transport.tcp.port: 9245  
discovery.zen.ping.unicast.hosts: ["192.168.1.1:9244", "192.168.1.2:9244"]  
discovery.zen.minimum\_master\_nodes: 1

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 3, 2019, 9:24am UTC](https://discuss.elastic.co/t/setting-up-2-nodes-on-same-machine/166858/2 "2019-02-03T09:24:19Z")

</div>

Communication within the Elasticsearch cluster is over the transport port, so you need to use `9245` in `discovery.zen.ping.unicast.hosts`. As you have 2 master eligible nods you should also set `discovery.zen.minimum_master_nodes` to `2` as per [these guidelines](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-node.html#split-brain).

---

<div class="post-metadata">

**Author:** ![Filip\_Pavlic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/filip_pavlic/32/27530_2.png) [@Filip\_Pavlic](https://discuss.elastic.co/u/Filip_Pavlic)\
**Post date:** [February 3, 2019, 9:55am UTC](https://discuss.elastic.co/t/setting-up-2-nodes-on-same-machine/166858/3 "2019-02-03T09:55:18Z")

</div>

Christian .. thank you! 🙂

Out of all combinations I haven't tried transport port for some reason.

As they communicate through transport port, I need to open TCP port only, right?

---

<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:** [March 3, 2019, 9:55am UTC](https://discuss.elastic.co/t/setting-up-2-nodes-on-same-machine/166858/4 "2019-03-03T09:55:18Z")

</div>

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