简体   繁体   中英

Curl can not connect to Elasticsearch

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日志

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

Tldr;

It feels like you might be hitting the wrong port.

default http port for Elasticsearch is 9200 not 9202 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM