3
votes

I got a weird issue with opening 9200 port on gce. After:

  1. Run VM in compute engine (Ubuntu 16.04) - yes, I know CentOS...not yet :-)
  2. Install elasticsearch
  3. gcloud compute --project realty4-1384 firewall-rules create allow-elasticsearch --allow TCP:9200 --target-tags elasticsearch

but sad Dinosaur saying that connection refused..... curl localhost:9200 - works nginx, varnish works in the same condition. I suspect something with rights maybe somebody can give me a hint. THANK YOU

1
Two questions about your GCE instance: - is it using the 'default' network? - does it have the elasticsearch tag?Vilas
yes, Vilas. It's exactly what I have, but connection refused :(. SOrry I missed your question - thank you for your time.Svitlana

1 Answers

2
votes

It was a huge torture for me, I tried to build elasticsearch to docker container and used kubernetes like orchetrator, all works perfectly until I start getting traffic. My aggregations tear everything apart.

So I have to find a way, spent a day with nginx nothing. Finally, haproxy did worked for me:

  1. sudo apt-get install haproxy
  2. sudo vim sudo vim /etc/haproxy/haproxy.cfg
  3. add after default section

    listen elastic bind 0.0.0.0:9500 mode http option forwardfor server elastic 127.0.0.1:9200 check

Make sure to open 9500 with tcp and IT DOES WORK!