# EC2 discovery issues with 2 local instances

**URL:** <https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429>\
**Category:** Elasticsearch\
**Created:** [March 18, 2014, 2:41pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429 "2014-03-18T14:41:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 2:41pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/1 "2014-03-18T14:41:39Z")

</div>

Hi,

I have a server with 2 ES instances. The first one is the master one, used  
to store documents. The second one is just there to receive requests from  
Kibana (I call it ES read-only), it has :

node.master: false

> node.data: false

Both are configured with cloud-aws plugin, and the http/java port are left  
by default for automatic assignment.

When master start first, it's binded to 9200/9300, then the second one to  
9201/9300. When I do : _curl -XGET  
'[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'_ everything is working  
as expected and both nodes are in the same cluster.

_But_, if I start the read-only instance first, discovery stop working. I  
have enabled DEBUG and TRACE but I didn't found what's the issue.

I also tried to hardcode the port allocation :

transport.tcp.port: 930(0/1)

> http.port: 920(0-1)

And after that, It's actually worse, whatever the order I start the  
instances, EC2 discovery is broken. So it's sort of a race-condition that's  
happening.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 18, 2014, 3:00pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/2 "2014-03-18T15:00:15Z")

</div>

I think I understand what is happening here.

Wondering if giving another elasticsearch.yml file as à configuration for the second node with all defaults (except cluster name) could help.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 18 mars 2014 à 15:41, Bastien Chong [bastien974@gmail.com](mailto:bastien974@gmail.com) a écrit :
> 
> Hi,
> 
> I have a server with 2 ES instances. The first one is the master one, used to store documents. The second one is just there to receive requests from Kibana (I call it ES read-only), it has :
> 
> > node.master: false  
> > node.data: false
> 
> Both are configured with cloud-aws plugin, and the http/java port are left by default for automatic assignment.
> 
> When master start first, it's binded to 9200/9300, then the second one to 9201/9300. When I do : curl -XGET '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)' everything is working as expected and both nodes are in the same cluster.
> 
> But, if I start the read-only instance first, discovery stop working. I have enabled DEBUG and TRACE but I didn't found what's the issue.
> 
> I also tried to hardcode the port allocation :
> 
> > transport.tcp.port: 930(0/1)  
> > http.port: 920(0-1)
> 
> ## And after that, It's actually worse, whatever the order I start the instances, EC2 discovery is broken. So it's sort of a race-condition that's happening.
> 
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/914F1C15-3832-4C45-BD7C-095286011D23%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/914F1C15-3832-4C45-BD7C-095286011D23%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 3:25pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/3 "2014-03-18T15:25:48Z")

</div>

I'm not sure what I can change since I have the bare minimum config :

The only difference between the 2 elasticsearch.yml config file are:

node.master: false

> node.data: false  
> path.conf: /etc/elasticsearchro  
> path.data: /var/lib/elasticsearchro

Both config share this part:

cluster.name: ESCluster

> cloud:  
> aws:  
> access\_key: xxxxxxxxxxxxxxxxxx  
> secret\_key: xxxxxxxxxxxxx  
> region: us-west-2  
> discovery:  
> type: ec2  
> ec2:  
> tag:  
> elasticsearch: true

On Tuesday, March 18, 2014 11:00:15 AM UTC-4, David Pilato wrote:

> I think I understand what is happening here.
> 
> Wondering if giving another elasticsearch.yml file as à configuration for  
> the second node with all defaults (except cluster name) could help.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 18 mars 2014 à 15:41, Bastien Chong \<[basti...@gmail.com](mailto:basti...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Hi,
> 
> I have a server with 2 ES instances. The first one is the master one, used  
> to store documents. The second one is just there to receive requests from  
> Kibana (I call it ES read-only), it has :
> 
> node.master: false
> 
> > node.data: false
> 
> Both are configured with cloud-aws plugin, and the http/java port are left  
> by default for automatic assignment.
> 
> When master start first, it's binded to 9200/9300, then the second one to  
> 9201/9300. When I do : _curl -XGET  
> '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'  
> [http://localhost:9200/\_cluster/health?pretty=true'](http://localhost:9200/_cluster/health?pretty=true')_ everything is  
> working as expected and both nodes are in the same cluster.
> 
> _But_, if I start the read-only instance first, discovery stop working. I  
> have enabled DEBUG and TRACE but I didn't found what's the issue.
> 
> I also tried to hardcode the port allocation :
> 
> transport.tcp.port: 930(0/1)
> 
> > http.port: 920(0-1)
> 
> And after that, It's actually worse, whatever the order I start the  
> instances, EC2 discovery is broken. So it's sort of a race-condition that's  
> happening.
> 
> --  
> 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 18, 2014, 5:33pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/4 "2014-03-18T17:33:16Z")

</div>

For the second node, remove  
aws:  
access\_key: xxxxxxxxxxxxxxxxxx  
secret\_key: xxxxxxxxxxxxx  
region: us-west-2  
discovery:  
type: ec2  
ec2:  
tag:  
elasticsearch: true

It should work I think.  
Or set unicast to localhost and disable multicast

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 18 mars 2014 à 16:25:52, Bastien Chong ([bastien974@gmail.com](mailto:bastien974@gmail.com)) a écrit:

I'm not sure what I can change since I have the bare minimum config :

The only difference between the 2 elasticsearch.yml config file are:

node.master: false  
node.data: false  
path.conf: /etc/elasticsearchro  
path.data: /var/lib/elasticsearchro

Both config share this part:

cluster.name: ESCluster  
cloud:  
aws:  
access\_key: xxxxxxxxxxxxxxxxxx  
secret\_key: xxxxxxxxxxxxx  
region: us-west-2  
discovery:  
type: ec2  
ec2:  
tag:  
elasticsearch: true

On Tuesday, March 18, 2014 11:00:15 AM UTC-4, David Pilato wrote:  
I think I understand what is happening here.

Wondering if giving another elasticsearch.yml file as à configuration for the second node with all defaults (except cluster name) could help.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 18 mars 2014 à 15:41, Bastien Chong [basti...@gmail.com](mailto:basti...@gmail.com) a écrit :

Hi,

I have a server with 2 ES instances. The first one is the master one, used to store documents. The second one is just there to receive requests from Kibana (I call it ES read-only), it has :

node.master: false  
node.data: false

Both are configured with cloud-aws plugin, and the http/java port are left by default for automatic assignment.

When master start first, it's binded to 9200/9300, then the second one to 9201/9300. When I do : curl -XGET '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)' everything is working as expected and both nodes are in the same cluster.

But, if I start the read-only instance first, discovery stop working. I have enabled DEBUG and TRACE but I didn't found what's the issue.

I also tried to hardcode the port allocation :

transport.tcp.port: 930(0/1)  
http.port: 920(0-1)

## And after that, It's actually worse, whatever the order I start the instances, EC2 discovery is broken. So it's sort of a race-condition that's happening.

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.5328835c.737b8ddc.97ca%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.5328835c.737b8ddc.97ca%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 6:03pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/5 "2014-03-18T18:03:00Z")

</div>

What I didn't mention, is that this node won't be alone, there will be  
about 6 other identical node, so I need the EC2 discovery feature.

On Tuesday, March 18, 2014 1:33:16 PM UTC-4, David Pilato wrote:

> For the second node, remove
> 
> ```
> aws:
> 
> ```
> 
> > ```
> > access_key: xxxxxxxxxxxxxxxxxx
> > secret_key: xxxxxxxxxxxxx
> > region: us-west-2
> > 
> > ```
> > 
> > discovery:  
> > type: ec2  
> > ec2:  
> > tag:  
> > elasticsearch: true
> 
> > It should work I think.  
> > Or set unicast to localhost and disable multicast
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 18 mars 2014 à 16:25:52, Bastien Chong ([basti...@gmail.com](mailto:basti...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> I'm not sure what I can change since I have the bare minimum config :
> 
> The only difference between the 2 elasticsearch.yml config file are:
> 
> node.master: false
> 
> > node.data: false  
> > path.conf: /etc/elasticsearchro  
> > path.data: /var/lib/elasticsearchro
> 
> Both config share this part:
> 
> cluster.name: ESCluster
> 
> > cloud:  
> > aws:  
> > access\_key: xxxxxxxxxxxxxxxxxx  
> > secret\_key: xxxxxxxxxxxxx  
> > region: us-west-2  
> > discovery:  
> > type: ec2  
> > ec2:  
> > tag:  
> > elasticsearch: true
> 
> On Tuesday, March 18, 2014 11:00:15 AM UTC-4, David Pilato wrote:
> 
> > I think I understand what is happening here.
> > 
> > Wondering if giving another elasticsearch.yml file as à configuration for  
> > the second node with all defaults (except cluster name) could help.
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 18 mars 2014 à 15:41, Bastien Chong [basti...@gmail.com](mailto:basti...@gmail.com) a écrit :
> > 
> > Hi,
> > 
> > I have a server with 2 ES instances. The first one is the master one,  
> > used to store documents. The second one is just there to receive requests  
> > from Kibana (I call it ES read-only), it has :
> > 
> > node.master: false
> > 
> > > node.data: false
> > 
> > Both are configured with cloud-aws plugin, and the http/java port are  
> > left by default for automatic assignment.
> > 
> > When master start first, it's binded to 9200/9300, then the second one to  
> > 9201/9300. When I do : _curl -XGET  
> > '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'  
> > [http://localhost:9200/\_cluster/health?pretty=true'](http://localhost:9200/_cluster/health?pretty=true')_ everything is  
> > working as expected and both nodes are in the same cluster.
> > 
> > _But_, if I start the read-only instance first, discovery stop working.  
> > I have enabled DEBUG and TRACE but I didn't found what's the issue.
> > 
> > I also tried to hardcode the port allocation :
> > 
> > transport.tcp.port: 930(0/1)
> > 
> > > http.port: 920(0-1)
> > 
> > ## And after that, It's actually worse, whatever the order I start the instances, EC2 discovery is broken. So it's sort of a race-condition that's happening.
> > 
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [March 18, 2014, 6:07pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/6 "2014-03-18T18:07:38Z")

</div>

May be I was unclear.

I know you need ec2 discovery.

but you have two nodes per machine.

Set the first one to use ec2 discovery and the second one to use regular discovery.

And could you open an issue in elasticsearch-cloud-aws plugin?

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 18 mars 2014 à 19:03:04, Bastien Chong ([bastien974@gmail.com](mailto:bastien974@gmail.com)) a écrit:

What I didn't mention, is that this node won't be alone, there will be about 6 other identical node, so I need the EC2 discovery feature.

On Tuesday, March 18, 2014 1:33:16 PM UTC-4, David Pilato wrote:  
For the second node, remove  
aws:  
access\_key: xxxxxxxxxxxxxxxxxx  
secret\_key: xxxxxxxxxxxxx  
region: us-west-2  
discovery:  
type: ec2  
ec2:  
tag:  
elasticsearch: true

It should work I think.  
Or set unicast to localhost and disable multicast

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 18 mars 2014 à 16:25:52, Bastien Chong ([basti...@gmail.com](mailto:basti...@gmail.com)) a écrit:

I'm not sure what I can change since I have the bare minimum config :

The only difference between the 2 elasticsearch.yml config file are:

node.master: false  
node.data: false  
path.conf: /etc/elasticsearchro  
path.data: /var/lib/elasticsearchro

Both config share this part:

cluster.name: ESCluster  
cloud:  
aws:  
access\_key: xxxxxxxxxxxxxxxxxx  
secret\_key: xxxxxxxxxxxxx  
region: us-west-2  
discovery:  
type: ec2  
ec2:  
tag:  
elasticsearch: true

On Tuesday, March 18, 2014 11:00:15 AM UTC-4, David Pilato wrote:  
I think I understand what is happening here.

Wondering if giving another elasticsearch.yml file as à configuration for the second node with all defaults (except cluster name) could help.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 18 mars 2014 à 15:41, Bastien Chong [basti...@gmail.com](mailto:basti...@gmail.com) a écrit :

Hi,

I have a server with 2 ES instances. The first one is the master one, used to store documents. The second one is just there to receive requests from Kibana (I call it ES read-only), it has :

node.master: false  
node.data: false

Both are configured with cloud-aws plugin, and the http/java port are left by default for automatic assignment.

When master start first, it's binded to 9200/9300, then the second one to 9201/9300. When I do : curl -XGET '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)' everything is working as expected and both nodes are in the same cluster.

But, if I start the read-only instance first, discovery stop working. I have enabled DEBUG and TRACE but I didn't found what's the issue.

I also tried to hardcode the port allocation :

transport.tcp.port: 930(0/1)  
http.port: 920(0-1)

## And after that, It's actually worse, whatever the order I start the instances, EC2 discovery is broken. So it's sort of a race-condition that's happening.

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com). For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53288b6b.153ea438.97ca%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53288b6b.153ea438.97ca%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 6:34pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/7 "2014-03-18T18:34:56Z")

</div>

I tried without luck.  
I changed :

discovery.zen.ping.multicast.enabled: false

> discovery.zen.ping.unicast.hosts: ["localhost"]

and commented the plugin part.

So by starting the 'read-only' instance first, it get 9200/9300.  
Then I start the master instance (9201/9301)

In the Read-only log :

> sending to [#zen\_unicast\_1#][inet[localhost/127.0.0.1:9300]]

It's not finding that I have an instance on port 9301.

On Tuesday, March 18, 2014 2:07:38 PM UTC-4, David Pilato wrote:

> May be I was unclear.
> 
> I know you need ec2 discovery.
> 
> but you have two nodes per machine.
> 
> Set the first one to use ec2 discovery and the second one to use regular  
> discovery.
> 
> And could you open an issue in elasticsearch-cloud-aws plugin?
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 18 mars 2014 à 19:03:04, Bastien Chong ([basti...@gmail.com](mailto:basti...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> What I didn't mention, is that this node won't be alone, there will be  
> about 6 other identical node, so I need the EC2 discovery feature.
> 
> On Tuesday, March 18, 2014 1:33:16 PM UTC-4, David Pilato wrote:
> 
> > For the second node, remove
> > 
> > ```
> > aws:
> > 
> > ```
> > 
> > > ```
> > > access_key: xxxxxxxxxxxxxxxxxx
> > > secret_key: xxxxxxxxxxxxx
> > > region: us-west-2
> > > 
> > > ```
> > > 
> > > discovery:  
> > > type: ec2  
> > > ec2:  
> > > tag:  
> > > elasticsearch: true
> > 
> > > It should work I think.  
> > > Or set unicast to localhost and disable multicast
> > 
> > ```
> > -- 
> > 
> > ```
> > 
> > _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> > 
> > Le 18 mars 2014 à 16:25:52, Bastien Chong ([basti...@gmail.com](mailto:basti...@gmail.com)) a écrit:
> > 
> > I'm not sure what I can change since I have the bare minimum config :
> > 
> > The only difference between the 2 elasticsearch.yml config file are:
> > 
> > node.master: false
> > 
> > > node.data: false  
> > > path.conf: /etc/elasticsearchro  
> > > path.data: /var/lib/elasticsearchro
> > 
> > Both config share this part:
> > 
> > cluster.name: ESCluster
> > 
> > > cloud:  
> > > aws:  
> > > access\_key: xxxxxxxxxxxxxxxxxx  
> > > secret\_key: xxxxxxxxxxxxx  
> > > region: us-west-2  
> > > discovery:  
> > > type: ec2  
> > > ec2:  
> > > tag:  
> > > elasticsearch: true
> > 
> > On Tuesday, March 18, 2014 11:00:15 AM UTC-4, David Pilato wrote:
> > 
> > > I think I understand what is happening here.
> > > 
> > > Wondering if giving another elasticsearch.yml file as à configuration  
> > > for the second node with all defaults (except cluster name) could help.
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 18 mars 2014 à 15:41, Bastien Chong [basti...@gmail.com](mailto:basti...@gmail.com) a écrit :
> > > 
> > > Hi,
> > > 
> > > I have a server with 2 ES instances. The first one is the master one,  
> > > used to store documents. The second one is just there to receive requests  
> > > from Kibana (I call it ES read-only), it has :
> > > 
> > > node.master: false
> > > 
> > > > node.data: false
> > > 
> > > Both are configured with cloud-aws plugin, and the http/java port are  
> > > left by default for automatic assignment.
> > > 
> > > When master start first, it's binded to 9200/9300, then the second one  
> > > to 9201/9300. When I do : _curl -XGET  
> > > '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'  
> > > [http://localhost:9200/\_cluster/health?pretty=true'](http://localhost:9200/_cluster/health?pretty=true')_ everything is  
> > > working as expected and both nodes are in the same cluster.
> > > 
> > > _But_, if I start the read-only instance first, discovery stop working.  
> > > I have enabled DEBUG and TRACE but I didn't found what's the issue.
> > > 
> > > I also tried to hardcode the port allocation :
> > > 
> > > transport.tcp.port: 930(0/1)
> > > 
> > > > http.port: 920(0-1)
> > > 
> > > ## And after that, It's actually worse, whatever the order I start the instances, EC2 discovery is broken. So it's sort of a race-condition that's happening.
> > > 
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/8851834f-cefd-4732-8c34-f3410cec0c99%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f31f79ec-ad39-440f-b2cd-36b642e18d48%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/bd4fb871-4113-418d-974c-6a7dd1f26975%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b389d676-df53-4bb6-9e54-fc939b4d6cac%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b389d676-df53-4bb6-9e54-fc939b4d6cac%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 7:21pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/8 "2014-03-18T19:21:00Z")

</div>

I also tried to comment the EC2 config on the master and enable unicast  
discovery.

Same issue !

On Tuesday, March 18, 2014 10:41:39 AM UTC-4, Bastien Chong wrote:

> Hi,
> 
> I have a server with 2 ES instances. The first one is the master one, used  
> to store documents. The second one is just there to receive requests from  
> Kibana (I call it ES read-only), it has :
> 
> node.master: false
> 
> > node.data: false
> 
> Both are configured with cloud-aws plugin, and the http/java port are left  
> by default for automatic assignment.
> 
> When master start first, it's binded to 9200/9300, then the second one to  
> 9201/9300. When I do : _curl -XGET  
> '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)  
> [http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'_ everything is  
> working as expected and both nodes are in the same cluster.
> 
> _But_, if I start the read-only instance first, discovery stop working. I  
> have enabled DEBUG and TRACE but I didn't found what's the issue.
> 
> I also tried to hardcode the port allocation :
> 
> transport.tcp.port: 930(0/1)
> 
> > http.port: 920(0-1)
> 
> And after that, It's actually worse, whatever the order I start the  
> instances, EC2 discovery is broken. So it's sort of a race-condition that's  
> happening.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7778b165-f596-4638-82c2-523ee13c9857%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7778b165-f596-4638-82c2-523ee13c9857%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 7:29pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/9 "2014-03-18T19:29:16Z")

</div>

The common denominator is that when I start a [\*node.master: false]  
[node.data: false] \*node fist, the cluster is not created properly, no  
matter how the discovery is configured, EC2 or unicast localhost.

On Tuesday, March 18, 2014 10:41:39 AM UTC-4, Bastien Chong wrote:

> Hi,
> 
> I have a server with 2 ES instances. The first one is the master one, used  
> to store documents. The second one is just there to receive requests from  
> Kibana (I call it ES read-only), it has :
> 
> node.master: false
> 
> > node.data: false
> 
> Both are configured with cloud-aws plugin, and the http/java port are left  
> by default for automatic assignment.
> 
> When master start first, it's binded to 9200/9300, then the second one to  
> 9201/9300. When I do : _curl -XGET  
> '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)  
> [http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'_ everything is  
> working as expected and both nodes are in the same cluster.
> 
> _But_, if I start the read-only instance first, discovery stop working. I  
> have enabled DEBUG and TRACE but I didn't found what's the issue.
> 
> I also tried to hardcode the port allocation :
> 
> transport.tcp.port: 930(0/1)
> 
> > http.port: 920(0-1)
> 
> And after that, It's actually worse, whatever the order I start the  
> instances, EC2 discovery is broken. So it's sort of a race-condition that's  
> happening.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d18b9838-188a-4efe-bb0f-dccba07fbd79%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d18b9838-188a-4efe-bb0f-dccba07fbd79%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Bastien\_Chong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bastien_chong/32/1393_2.png) [@Bastien\_Chong](https://discuss.elastic.co/u/Bastien_Chong)\
**Post date:** [March 18, 2014, 7:58pm UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/10 "2014-03-18T19:58:52Z")

</div>

Opening a new thread.  
[https://groups.google.com/forum/#!topic/elasticsearch/tJi7iJhU9ZU](https://groups.google.com/forum/#!topic/elasticsearch/tJi7iJhU9ZU)

On Tuesday, March 18, 2014 3:29:16 PM UTC-4, Bastien Chong wrote:

> The common denominator is that when I start a [\*node.master: false]  
> [node.data: false] \*node fist, the cluster is not created properly, no  
> matter how the discovery is configured, EC2 or unicast localhost.
> 
> On Tuesday, March 18, 2014 10:41:39 AM UTC-4, Bastien Chong wrote:
> 
> > Hi,
> > 
> > I have a server with 2 ES instances. The first one is the master one,  
> > used to store documents. The second one is just there to receive requests  
> > from Kibana (I call it ES read-only), it has :
> > 
> > node.master: false
> > 
> > > node.data: false
> > 
> > Both are configured with cloud-aws plugin, and the http/java port are  
> > left by default for automatic assignment.
> > 
> > When master start first, it's binded to 9200/9300, then the second one to  
> > 9201/9300. When I do : _curl -XGET  
> > '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)  
> > [http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'_ everything is  
> > working as expected and both nodes are in the same cluster.
> > 
> > _But_, if I start the read-only instance first, discovery stop working.  
> > I have enabled DEBUG and TRACE but I didn't found what's the issue.
> > 
> > I also tried to hardcode the port allocation :
> > 
> > transport.tcp.port: 930(0/1)
> > 
> > > http.port: 920(0-1)
> > 
> > And after that, It's actually worse, whatever the order I start the  
> > instances, EC2 discovery is broken. So it's sort of a race-condition that's  
> > happening.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ce057522-32e5-429f-a069-ccee522f6d1c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ce057522-32e5-429f-a069-ccee522f6d1c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:42am UTC](https://discuss.elastic.co/t/ec2-discovery-issues-with-2-local-instances/16429/11 "2017-07-06T01:42:25Z")

</div>


