# ec2 discovery

**URL:** https://discuss.elastic.co/t/ec2-discovery/4685
**Category:** Elasticsearch
**Created:** [June 22, 2011, 2:24pm UTC](https://discuss.elastic.co/t/ec2-discovery/4685 "2011-06-22T14:24:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Karl\_Baum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_baum/32/3186_2.png) [@Karl\_Baum](https://discuss.elastic.co/u/Karl_Baum)
#### Post date: [June 22, 2011, 2:24pm UTC](https://discuss.elastic.co/t/ec2-discovery/4685/1 "2011-06-22T14:24:04Z")

</div>

I am attempting to get ec2 discovery working but thus far i think i  
have been unsuccessful. My config file looks like:

[https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)

I have two instances running on two different ec2 instances, but when  
i run cluster health, it gives back only 1 node:

{ "active\_primary\_shards" : 6,  
"active\_shards" : 6,  
"cluster\_name" : "emailsync\_elasticsearch",  
"initializing\_shards" : 0,  
"number\_of\_data\_nodes" : 1,  
"number\_of\_nodes" : 1,  
"relocating\_shards" : 0,  
"status" : "yellow",  
"timed\_out" : false,  
"unassigned\_shards" : 6  
}

Anything obvious i am getting wrong?

Thx!

-karl

---

<div class="post-metadata">

### Author: ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)
#### Post date: [June 22, 2011, 3:10pm UTC](https://discuss.elastic.co/t/ec2-discovery/4685/2 "2011-06-22T15:10:04Z")

</div>

For 0.16.2 and below I think you may have to specify the tcp.host as the  
private ipv4 address. This is what the ec2 plugin will add to zen so if tcp  
has not bound to that address they will not find each other.

what do you see in the logs?

On Wed, Jun 22, 2011 at 3:24 PM, Karl [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:

> I am attempting to get ec2 discovery working but thus far i think i  
> have been unsuccessful. My config file looks like:
> 
> [https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)
> 
> I have two instances running on two different ec2 instances, but when  
> i run cluster health, it gives back only 1 node:
> 
> { "active\_primary\_shards" : 6,  
> "active\_shards" : 6,  
> "cluster\_name" : "emailsync\_elasticsearch",  
> "initializing\_shards" : 0,  
> "number\_of\_data\_nodes" : 1,  
> "number\_of\_nodes" : 1,  
> "relocating\_shards" : 0,  
> "status" : "yellow",  
> "timed\_out" : false,  
> "unassigned\_shards" : 6  
> }
> 
> Anything obvious i am getting wrong?
> 
> Thx!
> 
> -karl

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

### Author: ![Karl\_Baum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_baum/32/3186_2.png) [@Karl\_Baum](https://discuss.elastic.co/u/Karl_Baum)
#### Post date: [June 22, 2011, 3:26pm UTC](https://discuss.elastic.co/t/ec2-discovery/4685/3 "2011-06-22T15:26:12Z")

</div>

Hi Paul. I am a bit confused because my elasticsearch does not supply any ip addresses.. just my ec2 account information.

I am running into a bit of trouble with my logs. Somehow i have disabled logging to a file in an attempt to turn trace on for discovery.

[https://gist.github.com/4a6e846163315c0cb9b3](https://gist.github.com/4a6e846163315c0cb9b3)

Thanks for your help!

-karl

On Jun 22, 2011, at 11:10 AM, Paul Loy wrote:

> For 0.16.2 and below I think you may have to specify the tcp.host as the private ipv4 address. This is what the ec2 plugin will add to zen so if tcp has not bound to that address they will not find each other.
> 
> what do you see in the logs?
> 
> On Wed, Jun 22, 2011 at 3:24 PM, Karl [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:  
> I am attempting to get ec2 discovery working but thus far i think i  
> have been unsuccessful. My config file looks like:
> 
> [https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)
> 
> I have two instances running on two different ec2 instances, but when  
> i run cluster health, it gives back only 1 node:
> 
> { "active\_primary\_shards" : 6,  
> "active\_shards" : 6,  
> "cluster\_name" : "emailsync\_elasticsearch",  
> "initializing\_shards" : 0,  
> "number\_of\_data\_nodes" : 1,  
> "number\_of\_nodes" : 1,  
> "relocating\_shards" : 0,  
> "status" : "yellow",  
> "timed\_out" : false,  
> "unassigned\_shards" : 6  
> }
> 
> Anything obvious i am getting wrong?
> 
> Thx!
> 
> -karl
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

### Author: ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)
#### Post date: [June 23, 2011, 11:00am UTC](https://discuss.elastic.co/t/ec2-discovery/4685/4 "2011-06-23T11:00:10Z")

</div>

That's what I mean. You need to specify, in your config, the private ipv4  
address as the tcp host. I think that's the publish\_host here:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

On Wed, Jun 22, 2011 at 4:26 PM, Karl Baum [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:

> Hi Paul. I am a bit confused because my elasticsearch does not supply any  
> ip addresses.. just my ec2 account information.
> 
> I am running into a bit of trouble with my logs. Somehow i have disabled  
> logging to a file in an attempt to turn trace on for discovery.
> 
> [https://gist.github.com/4a6e846163315c0cb9b3](https://gist.github.com/4a6e846163315c0cb9b3)
> 
> Thanks for your help!
> 
> -karl
> 
> On Jun 22, 2011, at 11:10 AM, Paul Loy wrote:
> 
> For 0.16.2 and below I think you may have to specify the tcp.host as the  
> private ipv4 address. This is what the ec2 plugin will add to zen so if tcp  
> has not bound to that address they will not find each other.
> 
> what do you see in the logs?
> 
> On Wed, Jun 22, 2011 at 3:24 PM, Karl [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:
> 
> > I am attempting to get ec2 discovery working but thus far i think i  
> > have been unsuccessful. My config file looks like:
> > 
> > [https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)
> > 
> > I have two instances running on two different ec2 instances, but when  
> > i run cluster health, it gives back only 1 node:
> > 
> > { "active\_primary\_shards" : 6,  
> > "active\_shards" : 6,  
> > "cluster\_name" : "emailsync\_elasticsearch",  
> > "initializing\_shards" : 0,  
> > "number\_of\_data\_nodes" : 1,  
> > "number\_of\_nodes" : 1,  
> > "relocating\_shards" : 0,  
> > "status" : "yellow",  
> > "timed\_out" : false,  
> > "unassigned\_shards" : 6  
> > }
> > 
> > Anything obvious i am getting wrong?
> > 
> > Thx!
> > 
> > -karl
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

### Author: ![Karl\_Baum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karl_baum/32/3186_2.png) [@Karl\_Baum](https://discuss.elastic.co/u/Karl_Baum)
#### Post date: [June 23, 2011, 11:24am UTC](https://discuss.elastic.co/t/ec2-discovery/4685/5 "2011-06-23T11:24:17Z")

</div>

Hmmm.. if that is the case why not just use zen discovery?

Thx!  
On Jun 23, 2011, at 7:00 AM, Paul Loy wrote:

> That's what I mean. You need to specify, in your config, the private ipv4 address as the tcp host. I think that's the publish\_host here: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/network.html)
> 
> On Wed, Jun 22, 2011 at 4:26 PM, Karl Baum [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:  
> Hi Paul. I am a bit confused because my elasticsearch does not supply any ip addresses.. just my ec2 account information.
> 
> I am running into a bit of trouble with my logs. Somehow i have disabled logging to a file in an attempt to turn trace on for discovery.
> 
> [https://gist.github.com/4a6e846163315c0cb9b3](https://gist.github.com/4a6e846163315c0cb9b3)
> 
> Thanks for your help!
> 
> -karl
> 
> On Jun 22, 2011, at 11:10 AM, Paul Loy wrote:
> 
> > For 0.16.2 and below I think you may have to specify the tcp.host as the private ipv4 address. This is what the ec2 plugin will add to zen so if tcp has not bound to that address they will not find each other.
> > 
> > what do you see in the logs?
> > 
> > On Wed, Jun 22, 2011 at 3:24 PM, Karl [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:  
> > I am attempting to get ec2 discovery working but thus far i think i  
> > have been unsuccessful. My config file looks like:
> > 
> > [https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)
> > 
> > I have two instances running on two different ec2 instances, but when  
> > i run cluster health, it gives back only 1 node:
> > 
> > { "active\_primary\_shards" : 6,  
> > "active\_shards" : 6,  
> > "cluster\_name" : "emailsync\_elasticsearch",  
> > "initializing\_shards" : 0,  
> > "number\_of\_data\_nodes" : 1,  
> > "number\_of\_nodes" : 1,  
> > "relocating\_shards" : 0,  
> > "status" : "yellow",  
> > "timed\_out" : false,  
> > "unassigned\_shards" : 6  
> > }
> > 
> > Anything obvious i am getting wrong?
> > 
> > Thx!
> > 
> > -karl
> > 
> > ## --
> > 
> > Paul Loy  
> > [paul@keteracel.com](mailto:paul@keteracel.com)  
> > [http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

### Author: ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)
#### Post date: [June 23, 2011, 11:34am UTC](https://discuss.elastic.co/t/ec2-discovery/4685/6 "2011-06-23T11:34:51Z")

</div>

it is a pain in 0.16.2 that you have to have specific config per node.  
However, in the next release of Elasticsearch you will get special values  
that will query EC2 meta-data to obtain the ip address, such as \_  
ec2:privateIp\_

You do already get benefits of using the ec2 plugin. You get Zen + the  
initial hosts set for you from EC2 instance information.

On Thu, Jun 23, 2011 at 12:24 PM, Karl Baum [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:

> Hmmm.. if that is the case why not just use zen discovery?
> 
> Thx!  
> On Jun 23, 2011, at 7:00 AM, Paul Loy wrote:
> 
> That's what I mean. You need to specify, in your config, the private ipv4  
> address as the tcp host. I think that's the publish\_host here:  
> [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/modules/network.html)
> 
> On Wed, Jun 22, 2011 at 4:26 PM, Karl Baum [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:
> 
> > Hi Paul. I am a bit confused because my elasticsearch does not supply any  
> > ip addresses.. just my ec2 account information.
> > 
> > I am running into a bit of trouble with my logs. Somehow i have disabled  
> > logging to a file in an attempt to turn trace on for discovery.
> > 
> > [https://gist.github.com/4a6e846163315c0cb9b3](https://gist.github.com/4a6e846163315c0cb9b3)
> > 
> > Thanks for your help!
> > 
> > -karl
> > 
> > On Jun 22, 2011, at 11:10 AM, Paul Loy wrote:
> > 
> > For 0.16.2 and below I think you may have to specify the tcp.host as the  
> > private ipv4 address. This is what the ec2 plugin will add to zen so if tcp  
> > has not bound to that address they will not find each other.
> > 
> > what do you see in the logs?
> > 
> > On Wed, Jun 22, 2011 at 3:24 PM, Karl [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:
> > 
> > > I am attempting to get ec2 discovery working but thus far i think i  
> > > have been unsuccessful. My config file looks like:
> > > 
> > > [https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)
> > > 
> > > I have two instances running on two different ec2 instances, but when  
> > > i run cluster health, it gives back only 1 node:
> > > 
> > > { "active\_primary\_shards" : 6,  
> > > "active\_shards" : 6,  
> > > "cluster\_name" : "emailsync\_elasticsearch",  
> > > "initializing\_shards" : 0,  
> > > "number\_of\_data\_nodes" : 1,  
> > > "number\_of\_nodes" : 1,  
> > > "relocating\_shards" : 0,  
> > > "status" : "yellow",  
> > > "timed\_out" : false,  
> > > "unassigned\_shards" : 6  
> > > }
> > > 
> > > Anything obvious i am getting wrong?
> > > 
> > > Thx!
> > > 
> > > -karl
> > 
> > ## --
> > 
> > Paul Loy  
> > [paul@keteracel.com](mailto:paul@keteracel.com)  
> > [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<div class="post-metadata">

### Author: ![Paul\_Loy](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@Paul\_Loy](https://discuss.elastic.co/u/Paul_Loy)
#### Post date: [June 23, 2011, 11:35am UTC](https://discuss.elastic.co/t/ec2-discovery/4685/7 "2011-06-23T11:35:36Z")

</div>

So, yeah, if you use master, you can get this already!

On Thu, Jun 23, 2011 at 12:34 PM, Paul Loy [keteracel@gmail.com](mailto:keteracel@gmail.com) wrote:

> it is a pain in 0.16.2 that you have to have specific config per node.  
> However, in the next release of Elasticsearch you will get special values  
> that will query EC2 meta-data to obtain the ip address, such as \_  
> ec2:privateIp\_
> 
> You do already get benefits of using the ec2 plugin. You get Zen + the  
> initial hosts set for you from EC2 instance information.
> 
> On Thu, Jun 23, 2011 at 12:24 PM, Karl Baum [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:
> 
> > Hmmm.. if that is the case why not just use zen discovery?
> > 
> > Thx!  
> > On Jun 23, 2011, at 7:00 AM, Paul Loy wrote:
> > 
> > That's what I mean. You need to specify, in your config, the private ipv4  
> > address as the tcp host. I think that's the publish\_host here:  
> > [Elastic — The Search AI Company | Elastic](http://www.elasticsearch.org/guide/reference/modules/network.html)
> > 
> > On Wed, Jun 22, 2011 at 4:26 PM, Karl Baum [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:
> > 
> > > Hi Paul. I am a bit confused because my elasticsearch does not supply  
> > > any ip addresses.. just my ec2 account information.
> > > 
> > > I am running into a bit of trouble with my logs. Somehow i have disabled  
> > > logging to a file in an attempt to turn trace on for discovery.
> > > 
> > > [https://gist.github.com/4a6e846163315c0cb9b3](https://gist.github.com/4a6e846163315c0cb9b3)
> > > 
> > > Thanks for your help!
> > > 
> > > -karl
> > > 
> > > On Jun 22, 2011, at 11:10 AM, Paul Loy wrote:
> > > 
> > > For 0.16.2 and below I think you may have to specify the tcp.host as the  
> > > private ipv4 address. This is what the ec2 plugin will add to zen so if tcp  
> > > has not bound to that address they will not find each other.
> > > 
> > > what do you see in the logs?
> > > 
> > > On Wed, Jun 22, 2011 at 3:24 PM, Karl [karl.baum@gmail.com](mailto:karl.baum@gmail.com) wrote:
> > > 
> > > > I am attempting to get ec2 discovery working but thus far i think i  
> > > > have been unsuccessful. My config file looks like:
> > > > 
> > > > [https://gist.github.com/563690af25d54f5708b2](https://gist.github.com/563690af25d54f5708b2)
> > > > 
> > > > I have two instances running on two different ec2 instances, but when  
> > > > i run cluster health, it gives back only 1 node:
> > > > 
> > > > { "active\_primary\_shards" : 6,  
> > > > "active\_shards" : 6,  
> > > > "cluster\_name" : "emailsync\_elasticsearch",  
> > > > "initializing\_shards" : 0,  
> > > > "number\_of\_data\_nodes" : 1,  
> > > > "number\_of\_nodes" : 1,  
> > > > "relocating\_shards" : 0,  
> > > > "status" : "yellow",  
> > > > "timed\_out" : false,  
> > > > "unassigned\_shards" : 6  
> > > > }
> > > > 
> > > > Anything obvious i am getting wrong?
> > > > 
> > > > Thx!
> > > > 
> > > > -karl
> > > 
> > > ## --
> > > 
> > > Paul Loy  
> > > [paul@keteracel.com](mailto:paul@keteracel.com)  
> > > [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)
> > 
> > ## --
> > 
> > Paul Loy  
> > [paul@keteracel.com](mailto:paul@keteracel.com)  
> > [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)
> 
> ## --
> 
> Paul Loy  
> [paul@keteracel.com](mailto:paul@keteracel.com)  
> [Paul Loy - Amihan Entertainment | LinkedIn](http://uk.linkedin.com/in/paulloy)

## --

Paul Loy  
[paul@keteracel.com](mailto:paul@keteracel.com)  
[http://uk.linkedin.com/in/paulloy](http://uk.linkedin.com/in/paulloy)

---

<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, 4:02am UTC](https://discuss.elastic.co/t/ec2-discovery/4685/8 "2017-07-06T04:02:52Z")

</div>


