EC2 Elastic Search

I spent some time looking for information on elasticsearch.yml configurations that make my single Elasticsearch instance (on Windows Server 2003 EC2) accessible via the public ip, but every time I uncomment one or both of the following options, the only thing that changes is by calling private ip, also results in an error.

network.publish_host: <public ip>

network.bind_host: <private ip>

      

Is this correct and are there any other parameters that need to be determined? Should it work with the default values?

+3


source to share


2 answers


This is more of a general answer about how networking works in EC2 instead of a specific answer to your question. But it should help inform how to set up your application.

EC2 has 1: 1 NAT between public and private IP address. Because of this, only the private IP address is visible to the direct view.

If you bind a service to a network interface, it will be the one with the private IP.



Some services require knowledge of the external IP address in order to function properly. The only one I've run into is FTP in passive configuration, probably because it needs to open a separate socket for data transfer.

In the case of elasticity search, it looks like they have a special plugin that will help you customize the search for elastic objects in the aws environment: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-network.html

+3


source


I had the same problem.

There is only one ES instance installed on aws EC2 and wants to give it public access.

On ubuntu 16.04 this is what works for me:

in / etc / elasticsearch / elasticsearch.yml add this line:

network.host: <ec2 instance private ip>



The private ip should be something like 172.xxx

Also don't forget to allow security group access in your aws console for port 9200 (default) and the ip address from which you will send requests.

So the difference was to set up not a public but a private IP from the aws console.

Also note that this can be dangerous as there is no user / password or other access control

0


source







All Articles