elasticsearch启动后调用接口报master_not_discovered_exception
介绍
elasticsearch 7 启动正常
配置
cluster.name: skywallking-es
path.data: /pan_nfs/moniter2/data
network.host: 0.0.0.0
discovery.seed_hosts: ["10.64.35.14"]
调用接口
使用curl调用接口报错master_not_discovered_exception
curl -X GET http://10.64.35.14:9200/_cat/nodes?pretty
{
"error": {
"root_cause": [
{
"type": "master_not_discovered_exception",
"reason": null
}
],
"type": "master_not_discovered_exception",
"reason": null
},
"status": 503
}
解决方案
在elasticsearch每个配置文件指定初始节点
单实例的也要加上这个配置,否则就会报错
cluster.initial_master_nodes: node-1
调整配置elasticsearch.yml
vim config/elasticsearch.yml
cluster.name: skywallking-es
network.host: 10.64.35.14
http.port: 9200
discovery.seed_hosts: ["10.64.35.14:9200"]
cluster.initial_master_nodes: ["10.64.35.14"]
重启elasticsearch
#查看elasticsearch进程
ps -ef | grep elastic
#杀死进程
kill -9 PID
#启动elasticsearch
bin/elasticsearch -d
测试
curl -X GET http://10.64.35.14:9200/_cat/nodes?pretty
10.64.35.14 12 23 0 0.07 0.08 0.08 dilmrt * code404.icu
CSDN_码404:elasticsearch启动后调用接口报master_not_discovered_exception
https://www.code404.icu/1502.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。