Docker安装Elasticsearch 7.x设置默认账户密码出错

Posted keitsi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Docker安装Elasticsearch 7.x设置默认账户密码出错相关的知识,希望对你有一定的参考价值。

根据网上的教程,当完成了Elasticsearch 7.x安装后,会要求你用Docker命令登陆到master节点的容器执行以下命令来设置默认账户的密码。

bin/elasticsearch-setup-passwords interactive

以我的试验会得到以下报错,大致意思是抱怨连接不上这个URL。

Connection failure to: http://172.19.0.8:9200/_security/_authenticate?pretty failed: Connection refused

ERROR: Failed to connect to elasticsearch at http://172.19.0.8:9200/_security/_authenticate?pretty. Is the URL correct and elasticsearch running?

经查找172.19.0.8并非容器的IP,由此可见此命令并不能获得正确的URL,因此要指定Master节点的URL.

如下为完整的命令,其中es750-masterdata-1是其中一个Master节点的名字。

bin/elasticsearch-setup-passwords interactive -u ‘http://es750-masterdata-1:9200‘

 

以上是关于Docker安装Elasticsearch 7.x设置默认账户密码出错的主要内容,如果未能解决你的问题,请参考以下文章

记录下为了玩 docker 安装 CentOS 7 最简化版后遇到的一些问题

Elasticsearch 7.x 最详细安装及配置

Helm安装带验证的ElasticSearch 6.x 7.x 集群

CentOS 7.x安装ELK(Elasticsearch+Logstash+Kibana)

Docker- Centos 7.x 下安装 Docker

CentOS 7.x 安装 Docker