解決es集群啟動完成后報master_not_discovered_exception(hostname有錯誤)


環境:elasticsearch9

問題:

es集群啟動后,在瀏覽器輸入: http://es ip地址:端口/_cat/nodes?pretty,會提示如下錯誤:
{ "error" : { "root_cause" : [ { "type" : "master_not_discovered_exception", "reason" : null } ], "type" : "master_not_discovered_exception", "reason" : null }, "status" : 503 }
原因:查看日志 more /var/log/elasticsearch/my-application.log
     failed to resolve host [elk-host1]
    java.net.unknownHostException: elk-host1
   配置文件中host主機名稱錯誤
 
處理修改配置文件中的主機名稱:
vi /etc/elasticsearch/elasticsearch.yml 修改對應host主機名稱(注意修改所有的)
cluster.initial_master_nodes: ["node-1","node-2"]
 
重啟服務 systemctl restart elasticsearch

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM