# Can't get ec2 discovery working

**URL:** <https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604>\
**Category:** Elasticsearch\
**Created:** [January 19, 2016, 10:07pm UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604 "2016-01-19T22:07:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheker](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@Sheker](https://discuss.elastic.co/u/Sheker)\
**Post date:** [January 19, 2016, 10:07pm UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604/1 "2016-01-19T22:07:24Z")

</div>

Hi,  
I've been trying for hours to get 2 nodes to discover each other but I just can't get it working

I followed this:

> [@Node Discovery in elasticsearch on amazon EC2](https://discuss.elastic.co/t/node-discovery-in-elasticsearch-on-amazon-ec2/36490/17):
>
> I edited your answer to shows only uncommented settings. Some comments: Set network.publish\_host: \_ec2\_ Remove network.publish\_host: \_ec2:publicIpv4\_ Remove discovery.ec2.host\_type: public\_dns Remove discovery.zen.ping.unicast.hosts: ["ec2-52-23-160-86.compute-1.amazonaws.com"] Remove discovery.zen.ping.multicast.enabled: false And restart... So basically try elasticsearch.yml: cluster.name: my-app node.name: m+d bootstrap.mlockall: true network.host: \_ec2\_ cloud.aws.access\_key: XXXX…

and many other resources but no good so far

right now my config file looks like this ob both nodes except for the `node.name`:

> cluster.name: my\_cluster  
> node.name: node1  
> network.host: _ec2_  
> cloud.aws.access\_key: \*\*\*\*\*  
> cloud.aws.secret\_key: \*\*\*\*\*  
> discovery.type: ec2  
> discovery.ec2.groups: launch-wizard-1  
> cloud.aws.region: eu-west-1

perhaps it might be something with the ec2 configuration since I'm really new to AWS  
any way this is my installation code:

> sudo apt-get install language-pack-UTF-8  
> sudo apt-get update  
> sudo apt-get install openjdk-7-jre-headless -y  
> wget -qO - [https://packages.elastic.co/GPG-KEY-elasticsearch](https://packages.elastic.co/GPG-KEY-elasticsearch) | sudo apt-key add -  
> echo "deb [http://packages.elastic.co/elasticsearch/2.x/debian](http://packages.elastic.co/elasticsearch/2.x/debian) stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list  
> sudo apt-get update && sudo apt-get install elasticsearch  
> sudo update-rc.d elasticsearch defaults 95 10  
> sudo /usr/share/elasticsearch/bin/plugin install cloud-aws  
> sudo service elasticsearch start

Thanks

---

<div class="post-metadata">

**Author:** ![Sheker](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@Sheker](https://discuss.elastic.co/u/Sheker)\
**Post date:** [January 20, 2016, 9:48am UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604/2 "2016-01-20T09:48:35Z")

</div>

anyone?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 20, 2016, 10:01am UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604/3 "2016-01-20T10:01:00Z")

</div>

In case it helps: [https://www.elastic.co/guide/en/elasticsearch/plugins/current/cloud-aws-discovery.html#cloud-aws-discovery-permissions](https://www.elastic.co/guide/en/elasticsearch/plugins/current/cloud-aws-discovery.html#cloud-aws-discovery-permissions)

---

<div class="post-metadata">

**Author:** ![StephenGoodall](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@StephenGoodall](https://discuss.elastic.co/u/StephenGoodall)\
**Post date:** [February 3, 2016, 2:09pm UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604/4 "2016-02-03T14:09:13Z")

</div>

If it helps, I put these options in to my elasticsearch.yml:

logger.discovery: "DEBUG"  
cloud.aws.region: "eu-west"  
discovery.type: "ec2"  
network.host: "_ec2_"

and changed discovery.zen.ping.multicast.enabled to false. Not sure whether that is supposed to need changing but I think I had issues when it was true.

If you add the logger line you should at least see if the ec2 discovery is finding other nodes in the elasticsearch logs (/var/log/elasticsearch/{cluster-name}.log

---

<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:** [July 5, 2017, 11:19pm UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-working/39604/5 "2017-07-05T23:19:16Z")

</div>


