# Setting ElasticSearch 5.5.0 Cluster With discovery-ec2 Plugin

**URL:** <https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818>\
**Category:** Elasticsearch\
**Created:** [July 12, 2017, 1:46pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818 "2017-07-12T13:46:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SanE](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@SanE](https://discuss.elastic.co/u/SanE)\
**Post date:** [July 12, 2017, 1:46pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/1 "2017-07-12T13:46:42Z")

</div>

Hello,

I have Configured ElasticSearch Cluster (3 Nodes) with the discovery-ec2 plugin and my configuration below:

ES1 (Master Eligible)

```auto
cluster.name: my-cluster
path.data: /data/data
path.logs: /data/logs
network.host: _ec2_
node.data: true
node.master: true
cloud.node.auto_attributes: true
discovery.ec2.tag.es_cluster: prod-elasticsearch
discovery.zen.hosts_provider: ec2
cluster.routing.allocation.awareness.attributes: aws_availability_zone
cloud.aws.region: eu-west-1

```

ES2 (Master Eligible)

```auto
cluster.name: my-cluster
path.data: /data/data
path.logs: /data/logs
network.host: _ec2_
node.data: true
node.master: true
cloud.node.auto_attributes: true
discovery.ec2.tag.es_cluster: prod-elasticsearch
discovery.zen.hosts_provider: ec2
cluster.routing.allocation.awareness.attributes: aws_availability_zone
cloud.aws.region: eu-west-1

```

ES3

```auto
cluster.name: my-cluster
path.data: /data/data
path.logs: /data/logs
network.host: _ec2_
node.data: true
node.master: false
cloud.node.auto_attributes: true
discovery.zen.hosts_provider: ec2
discovery.ec2.tag.es_cluster: prod-elasticsearch
cluster.routing.allocation.awareness.attributes: aws_availability_zone
cloud.aws.region: eu-west-1

```

It is working fine with out creating EC2 Tags in AWS Console.

Should I Create the TAG in AWS Console?  
Can I go live with the configuration?

---

<div class="post-metadata">

**Author:** ![SanE](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@SanE](https://discuss.elastic.co/u/SanE)\
**Post date:** [July 27, 2017, 11:59am UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/2 "2017-07-27T11:59:23Z")

</div>

Hello, Can anybody help on this?

---

<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:** [July 27, 2017, 12:23pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/3 "2017-07-27T12:23:14Z")

</div>

I formated your initial post.

> It is working fine with out creating EC2 Tags in AWS Console.

So you mean that discovery is working well even though you did not set any AWS tag for your instances?

If so, then there is something wrong. I need to look at the code then.  
But can you confirm that first?

Can you run `GET _cat/nodes?v`?

---

<div class="post-metadata">

**Author:** ![SanE](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@SanE](https://discuss.elastic.co/u/SanE)\
**Post date:** [July 27, 2017, 1:27pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/4 "2017-07-27T13:27:45Z")

</div>

> [@dadoonet](#):
>
> \_cat/nodes?v?

```auto
[root@ip-10-3-4-73 ec2-user]# curl -XGET http://10.3.2.163:9200/_cat/nodes?v
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
10.3.0.217 4 59 0 0.00 0.00 0.00 mdi - jixD7ms
10.3.4.73 3 60 0 0.00 0.00 0.00 mdi * SZ4KwU4
10.3.2.163 3 59 0 0.03 0.01 0.00 mdi - aaeQZDf

```

---

<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:** [July 27, 2017, 1:39pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/5 "2017-07-27T13:39:42Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I formatted your post again.

Are you sure you did not define any tag for your AWS EC2 instances?  
Could you double-check that?

---

<div class="post-metadata">

**Author:** ![SanE](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@SanE](https://discuss.elastic.co/u/SanE)\
**Post date:** [July 27, 2017, 1:53pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/6 "2017-07-27T13:53:34Z")

</div>

```
Name
Prod-MM-Jobs-ES3

PROJECT
PROD-JOBS

User
ec2-user

```

I have created above tags only. Now I am facing the problem is I have stopped elastic search service in master ec2 instance and automatically removed instance from the cluster and shard re allocation has been successfully completed.  
Then started the elastic search but its not adding to the cluster again.

Again and stopped service from running master instance. Now the old instance added to the cluster.

---

<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:** [July 27, 2017, 3:14pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/7 "2017-07-27T15:14:37Z")

</div>

According to the code:

> <https://github.com/elastic/elasticsearch/blob/5.5/plugins/discovery-ec2/src/main/java/org/elasticsearch/discovery/ec2/AwsEc2UnicastHostsProvider.java#L210-L215>

If any tag is defined with `discovery.ec2.tag.FOO: BAR`, then AWS API will only send back instances which are having a tag `FOO` with value `BAR`.

Other instances should not come back and are going most likely not being able to join the cluster.

Can you reproduce your problem from scratch and describe here exactly all the steps?  
Also sharing your logs would help.

---

<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:** [August 24, 2017, 3:14pm UTC](https://discuss.elastic.co/t/setting-elasticsearch-5-5-0-cluster-with-discovery-ec2-plugin/92818/8 "2017-08-24T15:14:50Z")

</div>

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