mana
mana

Reputation: 1239

How to expose my Elastic Search server to the internet?

I've done installed my ElasticSearch (ES) Server on a VPS Centos. I did test the ES inside the Server and it response correctly.

My next step, is to allow my website which is host on a different web host to access and index its data content into my ES server.

My question is, what is the recommended way of exposed the ES to the internet, so my website can access to it to perform index and search? Is there's authentication method that I need to install ?

Upvotes: 4

Views: 3794

Answers (2)

Neeraj Singh Negi
Neeraj Singh Negi

Reputation: 363

enter image description here

You need to enable 3 parameters in /etc/elasticsearch/elasticsearch.yml

  1. network.host
  2. http.port
  3. discovery.seed_hosts

Upvotes: 1

Amit
Amit

Reputation: 32376

You need to include network.host:0.0.0.0 in your elasticsearch.yml file so that it listens on the non-loopback address and after that, if your app-server and ES are both in the same VPC, app-server will be able to connect to ES(provided if you exposed 9200 port in security group(in case of AWS).

And hopefully, your app-server port is exposed to the internet which internally connects to ES, you should not expose 9200 port of ES or Elasticsearch to the internet.

If you want an extra layer of security, you can enable x-pack basic which is included in the free tier and can be enabled using xpack.security.enabled: true in elasticsearch.config.

Refer x-pack features and configuration for more info.

Upvotes: 4

Related Questions