admin管理员组文章数量:1618717
docker安装es后无法访问
[root@localhost ~]# curl http://localhost:9200
curl: (56) Recv failure: Connection reset by peer
有人说是因为容器内监听的是本机地址127.0.0.1
[root@0adf1765ac08 elasticsearch]# netstat -tunpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:9200 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9300 0.0.0.0:* LISTEN -
修改监听地址,/usr/share/elasticsearch/config/elasticsearch.yml,地址改为0.0.0.0
[root@0adf1765ac08 elasticsearch]# netstat -tunpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:9200 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:9300 0.0.0.0:* LISTEN -
在宿主机访问可以了
[root@localhost ~]# curl http://localhost:9200
{
"name" : "0adf1765ac08",
"cluster_name" : "my-es",
"cluster_uuid" : "MpKqrEKySnSdwux0m7AlEA",
"version" : {
"number" : "7.7.1",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "ad56dce891c901a492bb1ee393f12dfff473a423",
"build_date" : "2020-05-28T16:30:01.040088Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
本文标签: 无法访问curlElasticsearchDockerReset
版权声明:本文标题:docker安装elasticsearch,无法访问curl: (56) Recv failure: Connection reset by peer 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1728786147a1173350.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论