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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值