elasticsearch启动后调用接口报master_not_discovered_exception

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

上一篇:Kubernetes(K8s) kubectl run 常用命令


下一篇:“控制器”模型