# Can't get EC2 discovery to work, always using zen

**URL:** <https://discuss.elastic.co/t/cant-get-ec2-discovery-to-work-always-using-zen/118815>\
**Category:** Elasticsearch\
**Created:** [February 7, 2018, 10:58am UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-to-work-always-using-zen/118815 "2018-02-07T10:58:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fredsted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fredsted/32/6656_2.png) [@fredsted](https://discuss.elastic.co/u/fredsted)\
**Post date:** [February 7, 2018, 10:58am UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-to-work-always-using-zen/118815/1 "2018-02-07T10:58:40Z")

</div>

Hi, I'm trying to use EC2 discovery with ES 6.1 and ES 6.2. It doesn't seem to work at all. I did of course install the plugin and add the neccessary config file, as well as adding the EC2 instance IAM role, but the log says it still uses "zen" discovery:

```
[2018-02-07T10:46:49,451][INFO][o.e.p.PluginsService] [esnode01] loaded plugin [discovery-ec2]
[2018-02-07T10:46:52,316][INFO][o.e.d.DiscoveryModule] [esnode01] using discovery type [zen]
[2018-02-07T10:46:53,032][INFO][o.e.n.Node] [esnode01] initialized
[2018-02-07T10:46:53,041][INFO][o.e.n.Node] [esnode01] starting ...

```

I've provided the **config** , **EC2 IAM role** and **logs** here: [https://gist.github.com/fredsted/e37d60948d9f765eef615b21eebc6bfd](https://gist.github.com/fredsted/e37d60948d9f765eef615b21eebc6bfd)

---

<div class="post-metadata">

**Author:** ![fredsted](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fredsted/32/6656_2.png) [@fredsted](https://discuss.elastic.co/u/fredsted)\
**Post date:** [February 7, 2018, 11:42am UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-to-work-always-using-zen/118815/2 "2018-02-07T11:42:10Z")

</div>

It looks like I needed to set the ec2 endpoint in `elasticsearch.yml`, and now it seemingly works.

```auto
discovery.ec2.endpoint: ec2.eu-central-1.amazonaws.com

```

I wonder if there is a bug in the autodetection here?

---

<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:** [February 7, 2018, 1:06pm UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-to-work-always-using-zen/118815/3 "2018-02-07T13:06:31Z")

</div>

There is a bug in the documentation.

> <https://github.com/elastic/elasticsearch/pull/27925>

See related:

> <https://github.com/elastic/elasticsearch/issues/27924>

---

<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 7, 2018, 1:07pm UTC](https://discuss.elastic.co/t/cant-get-ec2-discovery-to-work-always-using-zen/118815/4 "2018-03-07T13:07:18Z")

</div>

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