# Zen vs ec2 discovery

**URL:** <https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287>\
**Category:** Elasticsearch\
**Created:** [August 21, 2013, 5:31pm UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287 "2013-08-21T17:31:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 21, 2013, 5:31pm UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/1 "2013-08-21T17:31:55Z")

</div>

Which (if any) of the parameters documented at  
[http://www.elasticsearch.org/guide/reference/modules/discovery/zen/](http://www.elasticsearch.org/guide/reference/modules/discovery/zen/) apply  
when using the ec2 discovery mechanism  
([http://www.elasticsearch.org/guide/reference/modules/discovery/ec2/](http://www.elasticsearch.org/guide/reference/modules/discovery/ec2/))?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 23, 2013, 6:30pm UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/2 "2013-08-23T18:30:37Z")

</div>

Started a bounty for better documentation:

> <https://stackoverflow.com/questions/18157096/unreliable-discovery-for-elasticsearch-nodes-on-ec2>

On Wednesday, August 21, 2013 10:31:55 AM UTC-7, Eric Jain wrote:

> Which (if any) of the parameters documented at  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/discovery/zen/) apply  
> when using the ec2 discovery mechanism (  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/discovery/ec2/))?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Pierce\_Wetter](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pierce\_Wetter](https://discuss.elastic.co/u/Pierce_Wetter)\
**Post date:** [August 23, 2013, 7:55pm UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/3 "2013-08-23T19:55:25Z")

</div>

We ended up approaching this differently.

We just use plain old zen, but have some startup code that sets the aws  
zone into an environment variable which we use only for balance allocation  
awareness.

EC2 module seemed like overkill or maybe underkill because it didn't do  
what we wanted. Unicast only has to reach one of the hosts in the cluster,  
so we list a host from each zone. That way if any zone at all is up, all  
the machines can find each other.

That is, if you know you're going to have at least 3 nodes in your cluster,  
you can just list those 3 nodes in your config, and no matter how large  
your cluster is, the cluster will find those nodes and bootstrap.

Just my $.02.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 23, 2013, 10:04pm UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/4 "2013-08-23T22:04:39Z")

</div>

On Fri, Aug 23, 2013 at 12:55 PM, Pierce Wetter [obastard@gmail.com](mailto:obastard@gmail.com) wrote:

> We just use plain old zen,

I still haven't given up on the ec2 plugin; I replace all machines  
quite often (incl each time I do a small update), so having an  
automatic discovery mechanism simplifies things a lot! But if I can't  
find proper documentation and get it to work more reliably, I'll need  
to reconsider...

> but have some startup code that sets the aws zone  
> into an environment variable which we use only for balance allocation awareness.

Ensuring that replicas are spread out across multiple zones seems like  
a good idea; can you elaborate a bit how you accomplish this?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Pierce\_Wetter](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pierce\_Wetter](https://discuss.elastic.co/u/Pierce_Wetter)\
**Post date:** [August 24, 2013, 2:08am UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/5 "2013-08-24T02:08:55Z")

</div>

> Ensuring that replicas are spread out across multiple zones seems like  
> a good idea; can you elaborate a bit how you accomplish this?

It was stupidly easy with zen.

1. Count the number of zones you have. Subtract 1. That's the number of replicas you want.

2. Setup something on the host to put AWS\_ZONE in an environment variable. Like something in rc.init. Our Ops guys did this when I asked, looks like its making an ec2 API call and pulling the zone out of the answer.

3. In the config set:

cluster.routing.allocation.awareness.attributes: awszone

1. Set awszone as a node attribute.

That was it.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [August 24, 2013, 5:04am UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/6 "2013-08-24T05:04:33Z")

</div>

On Fri, Aug 23, 2013 at 7:08 PM, Pierce Wetter [obastard@gmail.com](mailto:obastard@gmail.com) wrote:

> cluster.routing.allocation.awareness.attributes: awszone

Neat, thanks for the tip!

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:19am UTC](https://discuss.elastic.co/t/zen-vs-ec2-discovery/13287/7 "2017-07-06T02:19:56Z")

</div>


