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'

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM