curl: (7) Failed connect to localhost:9200; Connection refused

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了curl: (7) Failed connect to localhost:9200; Connection refused相关的知识,希望对你有一定的参考价值。

参考技术A 连接Elasticsearch失败
报错如下:
curl: (7) Failed connect to localhost:9200; Connection refused

测试:
[root@instance-x0nj9foj es_soft]# curl localhost:9200
curl: (7) Failed connect to localhost:9200; Connection refused

查看端口
[root@instance-x0nj9foj es_soft]# netstat -lntup|grep 9200
tcp6 0 0 127.0.0.1:9200 :::* LISTEN 3587/java
tcp6 0 0 ::1:9200 :::* LISTEN 3587/java

查看log:

注意关键字:
[bvo4zCK] flood stage disk watermark [95%] exceeded on [bvo4zCKHTnyKHNLJzSfg9A][bvo4zCK][/var/lib/elasticsearch/nodes/0] free: 877.9mb[2.1%], all indices on this node will be marked read-only
此报错表示没有空间了

df-h果然服务器空间满了

查找大文件
find / -type f -size +500M

curl: (7) Failed connect to localhost:9200; Connection refused

参考技术A 连不上elasticsearch
报错如下:

[root@db01 /etc/elasticsearch]$ tail curl localhost:9200
curl: (7) Failed connect to localhost:9200; Connection refused

修改配置文件参数
vim /etc/elasticsearch/elasticsearch.yml
network.host: 0.0.0.0
重启服务
systemctl restart elasticsearch

测试成功!

以上是关于curl: (7) Failed connect to localhost:9200; Connection refused的主要内容,如果未能解决你的问题,请参考以下文章

curl: Failed to connect to 127.0.0.1 port 1086: Connection refused

curl: Failed to connect to raw.githubusercontent.com port 443: Connection refused

curl: Failed to connect to raw.githubusercontent.com port 443: Connection refused

我遇到的错误curl: Failed to connect to 127.0.0.1 port 1086: Connection refused

curl: Failed to connect to 127.**** port 1080: Connection refused on WSL2

MacOS安装brew报错:curl: Failed to connect to raw.githubusercontent.com port 443: Connection refused((代码