# Prevent an ES Node from joining a cluster based on an EC2 Tag?

**URL:** <https://discuss.elastic.co/t/prevent-an-es-node-from-joining-a-cluster-based-on-an-ec2-tag/10268>\
**Category:** Elasticsearch\
**Created:** [January 8, 2013, 7:45pm UTC](https://discuss.elastic.co/t/prevent-an-es-node-from-joining-a-cluster-based-on-an-ec2-tag/10268 "2013-01-08T19:45:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbrianjones](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbrianjones/32/1402_2.png) [@tbrianjones](https://discuss.elastic.co/u/tbrianjones)\
**Post date:** [January 8, 2013, 7:45pm UTC](https://discuss.elastic.co/t/prevent-an-es-node-from-joining-a-cluster-based-on-an-ec2-tag/10268/1 "2013-01-08T19:45:15Z")

</div>

I've got my elasticsearch.yml file set to filter ec2 nodes during discovery  
based on a group and a tag. I use the same security group for all my ES  
nodes ( jsut filtering other running servers in my account ) and thus, when  
I want to run a separate cluster, I assign a new value to a tag called  
'index'.

discovery.type: ec2  
discovery.ec2.groups: elasticsearch\_node  
discovery.ec2.tag.index: companies

My problem is that if I spin up a new Node Instance and assign a unique  
value to the 'index' tag during launch, this node still joins the running  
cluster because although the tag is different, the cluster.name in it's  
elasticsearch.yml file still matches the currently running cluster. It  
seems the tag filter only filters nodes during the discovery process (  
which makes sense ), but not when a new node is looking for clusters to  
join.

Is there a preferred way to deal with this use case? Could the AWS Gateway  
be configured to check the `discovery.ec2.tag.key` setting for a running  
cluster before a new node joins that cluster?

--

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [January 9, 2013, 7:26pm UTC](https://discuss.elastic.co/t/prevent-an-es-node-from-joining-a-cluster-based-on-an-ec2-tag/10268/2 "2013-01-09T19:26:21Z")

</div>

Brian Jones wrote:

> My problem is that if I spin up a new Node Instance and assign a  
> unique value to the 'index' tag during launch, this node still  
> joins the running cluster because although the tag is different,  
> the cluster.name in it's elasticsearch.yml file still matches the  
> currently running cluster. It seems the tag filter only filters  
> nodes during the discovery process ( which makes sense ), but not  
> when a new node is looking for clusters to join.

Forgive me if I missed this from your message, but why can you not  
provision a different cluster name for the new nodes? Why do you  
want nodes that share a cluster name not to be clustered together?

-Drew

--

---

<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 6, 2017, 2:57am UTC](https://discuss.elastic.co/t/prevent-an-es-node-from-joining-a-cluster-based-on-an-ec2-tag/10268/3 "2017-07-06T02:57:10Z")

</div>

Closed on July 6, 2017, 2:57am UTC


