環境: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
