1

I'm starting the Elasticsearch 7.11 in my linux, and it works when i run curl -XGET localhost:9200 INSIDE MY LINUX. But the issue is, i'm trying to access this Elasticsearch service started in my linux, inside a Devilbox docker, and when i run curl -XGET localhost:9200 on the CLI inside Devilbox, it returns 'connection refused'·

Already tried to change network.host to 0.0.0.0, 127.0.0.1 and it doesn't worked. Already tried to change discovery hosts to ["0.0.0.0", "[::1]"] and it doesn't worked too.

When i starts the service in my linux and runs curl -XGET localhost:9200 it returns: enter image description here

When i tried INSIDE DEVILBOX it returns: enter image description here

I'm triyng this way, because installing the elasticsearch inside devilbox container didn't worked. So i'm using the elasticsearch service outside the devilbox container.

5
  • did you try with change port number?
    – S.P
    Jun 13 at 13:26
  • @S.P tried to change port on elasticsearch/config/elasticsearch.yml, but when i starts the service, it remains on the same port(9200). There is a specif port to change ? Jun 13 at 13:57
  • use adminmagento private IP instead of localhost? curl -XGET private-ip:9200 Jun 13 at 13:59
  • @BilalUsean on devilbox it returns Connection refused, in the linux it returns the same. But running in the linux with 127.0.0.1:9200 it works. Jun 13 at 14:15
  • after update elasticsearch port, did u restart elasticsearch?
    – S.P
    Jun 15 at 5:04

2 Answers 2

1

Search for the line that contains network.host, uncomment it, and change the value to 0.0.0.0. Set the network host to 0.0.0.0 to listen on all interfaces and make it available publicly, Incase you want to configure this to be private/local to your machine. You will have to set the network.host to 127.0.0.1, so the content is not public.

sudo nano /etc/elasticsearch/elasticsearch.yml

network.host: 127.0.0.1
http.port: 9200

If your server only has 8GB of RAM, you must edit this setting. Open jvm.options:

sudo nano /etc/elasticsearch/jvm.options

Now change the Xms and Xmx values to 2g: /etc/elasticsearch/jvm.options

-Xms2g
-Xmx2g
0

solved this issue by changing network.host to 0.0.0.0 and discovery_seed.host to ["localhost", "127.0.0.1"] on the file elasticsearch/config/elasticsearch.yml

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.