# Discovery on EC2 - unicast, separate VPCs, public IPs

**URL:** <https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029>\
**Category:** Elasticsearch\
**Created:** [February 7, 2015, 10:43pm UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029 "2015-02-07T22:43:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugen\_Paraschiv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eugen_paraschiv/32/919_2.png) [@Eugen\_Paraschiv](https://discuss.elastic.co/u/Eugen_Paraschiv)\
**Post date:** [February 7, 2015, 10:43pm UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029/1 "2015-02-07T22:43:37Z")

</div>

Hi,  
I have the following simple EC2 topology:

- a VPC with my entire cluster, running in a public subnet
- a new slave in another VPC (also a public subnet)
- I'm using unicast - the slave has the following config:  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["master\_elastic\_ip:9300"]  
So - the slave points to the public IP of the master - not the private one.

However - this new slave tries to connect to the master on the private IP  
instead of the public one - and I'm getting:  
org.elasticsearch.common.netty.channel.ConnectTimeoutException: connection  
timed out: /172.61.51.253:9300  
Where 172.61.51.253 is the private IP.  
Not sure what that is - do I need to configure anything on the slave to  
make sure it uses the public IP to reach the master?  
Thanks,  
Eugen.

--  
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/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Norberto\_Meijome](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Norberto\_Meijome](https://discuss.elastic.co/u/Norberto_Meijome)\
**Post date:** [February 7, 2015, 10:53pm UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029/2 "2015-02-07T22:53:37Z")

</div>

Are you referring to the master server by fqdn or IP? If fqdn, don't  
forget about ec2's split horizon (though I don't think it should be  
resolvable across 2 separate VPCs...  
Can you open a socket from host 1 to host 2 manually (with nc or telnet) on  
TCP/9300?  
On 08/02/2015 9:43 am, "Eugen Paraschiv" [hanriseldon@gmail.com](mailto:hanriseldon@gmail.com) wrote:

> Hi,  
> I have the following simple EC2 topology:
> 
> - a VPC with my entire cluster, running in a public subnet
> - a new slave in another VPC (also a public subnet)
> - I'm using unicast - the slave has the following config:  
> discovery.zen.ping.multicast.enabled: false  
> discovery.zen.ping.unicast.hosts: ["master\_elastic\_ip:9300"]  
> So - the slave points to the public IP of the master - not the private  
> one.
> 
> However - this new slave tries to connect to the master on the private IP  
> instead of the public one - and I'm getting:  
> org.elasticsearch.common.netty.channel.ConnectTimeoutException: connection  
> timed out: /172.61.51.253:9300  
> Where 172.61.51.253 is the private IP.  
> Not sure what that is - do I need to configure anything on the slave to  
> make sure it uses the public IP to reach the master?  
> Thanks,  
> Eugen.
> 
> --  
> 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/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%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/CACj2-4JqqAynnkvJ85JW3EphiM22\_ONx1xHFH96-SrjZ2UKb6w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACj2-4JqqAynnkvJ85JW3EphiM22_ONx1xHFH96-SrjZ2UKb6w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan\_Gonzalez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan_gonzalez/32/40341_2.png) [@Ivan\_Gonzalez](https://discuss.elastic.co/u/Ivan_Gonzalez)\
**Post date:** [February 8, 2015, 8:04am UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029/3 "2015-02-08T08:04:13Z")

</div>

DNS queries inside vpc are resolved to the internal IP by aws servers.

One simple way is to use elastic IP for this computer and then point A  
register to that IP.  
El 07/02/2015 23:43, "Eugen Paraschiv" [hanriseldon@gmail.com](mailto:hanriseldon@gmail.com) escribió:

> Hi,  
> I have the following simple EC2 topology:
> 
> - a VPC with my entire cluster, running in a public subnet
> - a new slave in another VPC (also a public subnet)
> - I'm using unicast - the slave has the following config:  
> discovery.zen.ping.multicast.enabled: false  
> discovery.zen.ping.unicast.hosts: ["master\_elastic\_ip:9300"]  
> So - the slave points to the public IP of the master - not the private  
> one.
> 
> However - this new slave tries to connect to the master on the private IP  
> instead of the public one - and I'm getting:  
> org.elasticsearch.common.netty.channel.ConnectTimeoutException: connection  
> timed out: /172.61.51.253:9300  
> Where 172.61.51.253 is the private IP.  
> Not sure what that is - do I need to configure anything on the slave to  
> make sure it uses the public IP to reach the master?  
> Thanks,  
> Eugen.
> 
> --  
> 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/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%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/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD\_e-CM\_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD_e-CM_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Norberto\_Meijome](https://avatars.discourse-cdn.com/v4/letter/n/ed655f/32.png) [@Norberto\_Meijome](https://discuss.elastic.co/u/Norberto_Meijome)\
**Post date:** [February 8, 2015, 8:20am UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029/4 "2015-02-08T08:20:11Z")

</div>

Sure...the interesting point in the OP is the fact both servers are in  
different VPCs - not sure if it should be possible to resolve across vpcs  
...  
On 08/02/2015 7:04 pm, "Ivan G" [igonzalezvaliente@gmail.com](mailto:igonzalezvaliente@gmail.com) wrote:

> DNS queries inside vpc are resolved to the internal IP by aws servers.
> 
> One simple way is to use elastic IP for this computer and then point A  
> register to that IP.  
> El 07/02/2015 23:43, "Eugen Paraschiv" [hanriseldon@gmail.com](mailto:hanriseldon@gmail.com) escribió:
> 
> > Hi,  
> > I have the following simple EC2 topology:
> > 
> > - a VPC with my entire cluster, running in a public subnet
> > - a new slave in another VPC (also a public subnet)
> > - I'm using unicast - the slave has the following config:  
> > discovery.zen.ping.multicast.enabled: false  
> > discovery.zen.ping.unicast.hosts: ["master\_elastic\_ip:9300"]  
> > So - the slave points to the public IP of the master - not the private  
> > one.
> > 
> > However - this new slave tries to connect to the master on the private IP  
> > instead of the public one - and I'm getting:  
> > org.elasticsearch.common.netty.channel.ConnectTimeoutException:  
> > connection timed out: /172.61.51.253:9300  
> > Where 172.61.51.253 is the private IP.  
> > Not sure what that is - do I need to configure anything on the slave to  
> > make sure it uses the public IP to reach the master?  
> > Thanks,  
> > Eugen.
> > 
> > --  
> > 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/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%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/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD\_e-CM\_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD_e-CM_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD\_e-CM\_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD_e-CM_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.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/CACj2-4LNYv%2BrZZcZOt8rJTU6QcA1qAVdHNJzCutFzWwx%2B32Eew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACj2-4LNYv%2BrZZcZOt8rJTU6QcA1qAVdHNJzCutFzWwx%2B32Eew%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan\_Gonzalez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ivan_gonzalez/32/40341_2.png) [@Ivan\_Gonzalez](https://discuss.elastic.co/u/Ivan_Gonzalez)\
**Post date:** [February 8, 2015, 10:39am UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029/5 "2015-02-08T10:39:31Z")

</div>

It will work for sure, I was using this approach on some use cases

The point is that if this server is not going to be running usually, aws  
will continue charging you for the elastic ip even if no instance is up in  
that IP, but for the cost it is, I think it represents, the elastic ip is  
the best option.  
That said you can write your own script that register as A record the  
current public IP of the instance and avoid use elastic ip's.

--

_Iván González Valiente_

Senior Systems Developer

Tel. +34 675 962 588

2015-02-08 9:20 GMT+01:00 Norberto Meijome [numard@gmail.com](mailto:numard@gmail.com):

> Sure...the interesting point in the OP is the fact both servers are in  
> different VPCs - not sure if it should be possible to resolve across vpcs  
> ...  
> On 08/02/2015 7:04 pm, "Ivan G" [igonzalezvaliente@gmail.com](mailto:igonzalezvaliente@gmail.com) wrote:
> 
> > DNS queries inside vpc are resolved to the internal IP by aws servers.
> > 
> > One simple way is to use elastic IP for this computer and then point A  
> > register to that IP.  
> > El 07/02/2015 23:43, "Eugen Paraschiv" [hanriseldon@gmail.com](mailto:hanriseldon@gmail.com) escribió:
> > 
> > > Hi,  
> > > I have the following simple EC2 topology:
> > > 
> > > - a VPC with my entire cluster, running in a public subnet
> > > - a new slave in another VPC (also a public subnet)
> > > - I'm using unicast - the slave has the following config:  
> > > discovery.zen.ping.multicast.enabled: false  
> > > discovery.zen.ping.unicast.hosts: ["master\_elastic\_ip:9300"]  
> > > So - the slave points to the public IP of the master - not the private  
> > > one.
> > > 
> > > However - this new slave tries to connect to the master on the private  
> > > IP instead of the public one - and I'm getting:  
> > > org.elasticsearch.common.netty.channel.ConnectTimeoutException:  
> > > connection timed out: /172.61.51.253:9300  
> > > Where 172.61.51.253 is the private IP.  
> > > Not sure what that is - do I need to configure anything on the slave to  
> > > make sure it uses the public IP to reach the master?  
> > > Thanks,  
> > > Eugen.
> > > 
> > > --  
> > > 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/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/026f6d30-d496-4905-a5f9-80c6be82669b%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/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD\_e-CM\_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD_e-CM_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD\_e-CM\_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjOO6tU3qEsyf3xcD7QgZD_e-CM_g-oM9%2BRt%2B3LpBWPwUg%40mail.gmail.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/CACj2-4LNYv%2BrZZcZOt8rJTU6QcA1qAVdHNJzCutFzWwx%2B32Eew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACj2-4LNYv%2BrZZcZOt8rJTU6QcA1qAVdHNJzCutFzWwx%2B32Eew%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CACj2-4LNYv%2BrZZcZOt8rJTU6QcA1qAVdHNJzCutFzWwx%2B32Eew%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CACj2-4LNYv%2BrZZcZOt8rJTU6QcA1qAVdHNJzCutFzWwx%2B32Eew%40mail.gmail.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/CA%2BjeyjNZn2Auv60V9L-gL%2BzJcJDB4%2Bwb4B%2BTkqX0oXNOADaoew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2BjeyjNZn2Auv60V9L-gL%2BzJcJDB4%2Bwb4B%2BTkqX0oXNOADaoew%40mail.gmail.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, 12:34am UTC](https://discuss.elastic.co/t/discovery-on-ec2-unicast-separate-vpcs-public-ips/22029/6 "2017-07-06T00:34:18Z")

</div>


