Home > Blockchain >  Curl can not connect to Elasticsearch
Curl can not connect to Elasticsearch

Time:07-26

I installed elasticsearch and kibana from archieve files and try to learn them but I have some network / configuration problems When I run the following command

curl --cacert config/certs/http_ca.crt -m 15 -u elastic https://localhost:9200

I got following error

curl: (7) Failed to connect to localhost port 9200: Operation timed out

I have just uncommented the following line in elasticsearch.yml

network.host: 0.0.0.0

Becuase otherwise kibana throws the following error and doesn't start

Unable to retrieve version information from Elasticsearch nodes.

While I start elasticsearch throw some error but they don't prevent starting Logs

All I want to fix curl problem and run the following command

bin/elasticsearch-create-enrollment-token --scope node

It also returns

ERROR: Failed to determine the health of the cluster.

if I comment out network.hosts, curl can connect elasticsearch and

bin/elasticsearch-create-enrollment-token --scope node

works. But this time kibana does not work

Unable to retrieve version information from Elasticsearch nodes. connect ECONNREFUSED 127.0.0.1:9202

CodePudding user response:

Tldr;

It feels like you might be hitting the wrong port.

default http port for Elasticsearch is 9200 not 9202.

  • Related