# Elasticsearch nodes join cluster using discovery

**URL:** <https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674>\
**Category:** Elasticsearch\
**Created:** [February 10, 2017, 2:54pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674 "2017-02-10T14:54:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [February 10, 2017, 2:54pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674/1 "2017-02-10T14:54:31Z")

</div>

I installed 2 Elasticsearch 5.2 nodes on EC2, inside the same VPC. I set these two nodes with the security group to allow inbund port 9200, 9300 and ICMP within the same VPC. I installed ec2 discovery plugin for nodes to discover the cluster

I need these two Elasticsearch nodes to join the same cluster, the following is my settings.  
The followings are two elasticsearch.yml settings

```
discovery:
      type: ec2
cluster.name: mycluster
node.name: datanode1
node.master: true
node.data: true
node.ingest: false
path.data: /data
network.host: 10.XXX.XXX.XXX
network.publish_host: 10.XXX.XXX.XXX
network.bind_host: 10.XXX.XXX.XXX

discovery:
      type: ec2
cluster.name: mycluster
node.name: datanode2
node.master: true
node.data: true
node.ingest: false
path.data: /data
network.host: 10.XXX.XXX.XXX
network.publish_host: 10.XXX.XXX.XXX
network.bind_host: 10.XXX.XXX.XXX

```

The two nodes can do curl and ping to each other successfully, but they cannot discover each other.

I used to use Elasticsearch 2.3, we use zen discovery, and it works. But when I use the same settings in Elasticsearch 5.2, elasticsearch starts for few seconds and stops  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["host1","host2"]

How can I make these two Elasticsearch 5.2 nodes to join in one cluster?

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [February 10, 2017, 3:45pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674/2 "2017-02-10T15:45:27Z")

</div>

Do you want to use Zen or EC2 discovery? Your config is a mix of the two. A properly configured EC2 discovery makes it so you don't have to provide an explicit list of hosts (see here: [https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/discovery-ec2.html](https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/discovery-ec2.html) )  
The `discovery.zen.ping.unicast.hosts` setting is not used for EC2 discovery but for the standard zen discovery mechanism (which you can get by setting the discovery type back to "zen") .

---

<div class="post-metadata">

**Author:** ![sharon.c](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sharon.c/32/16076_2.png) [@sharon.c](https://discuss.elastic.co/u/sharon.c)\
**Post date:** [February 10, 2017, 10:32pm UTC](https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674/3 "2017-02-10T22:32:08Z")

</div>

I want to use zen, because the ec2 instances are in the same vpc, I think it would be ok to use zen, right?

```
discovery:
      type: zen
cluster.name: mycluster
node.name: datanode1
node.master: true
node.data: true
node.ingest: false
path.data: /data
network.host: 10.XXX.XXX.XXX
network.publish_host: 10.XXX.XXX.XXX
network.bind_host: 10.XXX.XXX.XXX
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["10.XXX.XXX.XXX","10.XXX.XXX.XXX"]

```

is this correct configuration for zen?  
The nodes still cannot find each other to join a cluster

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [February 12, 2017, 10:16am UTC](https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674/4 "2017-02-12T10:16:50Z")

</div>

Can you establish a manual connection between the instances by running Elasticsearch on one instance and using `telnet 10.XXX.XXX.XXX 9300` on the other instance to check the connection? (Port 9300 is the default port used for inter-node communication). Have you properly set-up the security groups? See "Step 6: Configure Security Group" at [https://www.elastic.co/blog/running-elasticsearch-on-aws](https://www.elastic.co/blog/running-elasticsearch-on-aws)

---

<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 12, 2017, 10:16am UTC](https://discuss.elastic.co/t/elasticsearch-nodes-join-cluster-using-discovery/74674/5 "2017-03-12T10:16:49Z")

</div>

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