Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I expose ElasticSearch on an AWS instance?

I have installed ElasticSearch on an AWS instance and successfully tested it from another AWS instance. I want to use a .Net app on my remote machine to load my data to ElasticSearch.

How do I configure my AWS instance to allow connectivity over TCP port 9200 from my remote machine? I have verified that iptables is off and the ES process is bound to 0.0.0.0.

Thanks in advance.

like image 753
user481779 Avatar asked Jan 08 '23 15:01

user481779


1 Answers

In your EC2 dashboard, on the left-hand menu, there is 'Security Group'. Find which 'Security Group' your instance uses (you can find it in the instance description).

Select the security group, select 'Inbound' tab, then click 'Edit'. Add 'Custom TCP' rule, set port to be 9200 and set Source to be 'Anywhere'.

Leaving port 9200 open to world "Source to be 'Anywhere'" is not recommended. You can open this port for the subnet or IP of your EC2 instances from which you(your App) want to access elasticsearch.

Security Group

like image 119
Alex Napitupulu Avatar answered Jan 20 '23 00:01

Alex Napitupulu