Google Cloud Platform - Connecting to Elastic Search

Viewed 539

I am trying to access Elastic Search via my static IP address but it's not working.

What did I try?

  1. I created a Bitnami Elastic Search VM Instance from GCP Marketplace
  2. I assigned a static IP to the same VM
  3. I replaced the network.host to 0.0.0.0 inside elasticsearch.yml file
  4. I added my static IP to network.publish_host inside elasticsearch.yml file
  5. I added a firewall rule to allow all ports and added 0.0.0.0 as source filter

Now when trying to access Elastic Search using http://_my_static_ip:9200 I get nothing, the request fails. What am I missing here?? Any help would be appreciated. Thanks

1 Answers

The issue was my GCP being using an IPv6 address, I didn't know about this, this is something a developer on Fiverr told me, anyone having the same issue with Bitnami's GCP deployment needs to add the following line:

-Djava.net.preferIPv4Stack=true

to the following file:

/opt/bitnami/elasticsearch/config/jvm.options

After that restart your elasticsearc service using the following command:

sudo /opt/bitnami/ctlscript.sh restart

That should fix the issue if you have proper firewall rules set up and also added proper IPs to elasticsearch.yml config file. Read original question's What did I try? section.

Related