【问题标题】:"master_not_discovered_exception" when trying to configure Elastic Search on remote server尝试在远程服务器上配置弹性搜索时出现“master_not_discovered_exception”
【发布时间】:2019-11-09 10:49:30
【问题描述】:

我正在尝试在我们的一台远程服务器上配置 Elastic Search。我已经使用 .msi 安装文件 (v7.1.1) 安装了它,并为 9200 和 9300 端口配置了防火墙。

当我将 network.publish_host 设置为服务器 ip 时,它给了我这个错误 the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured。然后我做了一些研究并将cluster.initial_master_nodes 设置为我名为“ElasticSearchNode”的单个节点。现在服务正在运行,但是当我检查集群运行状况时,它显示“master_not_discovered_exception”。

我当前的 yml 文件如下所示:

bootstrap.memory_lock: false
cluster.name: elasticsearch
http.port: 9200
node.data: true
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1
node.name: ElasticSearchNode
path.data: C:\ProgramData\Elastic\Elasticsearch\data
path.logs: C:\ProgramData\Elastic\Elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic
xpack.security.enabled: false
network.host: 0.0.0.0
network.publish_host: x.x.x.x
cluster.initial_master_nodes: ElasticSearchNode
discovery.zen.minimum_master_nodes: 1

我请求 /_cat/health?v 时的响应

{"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}

任何帮助将不胜感激。

【问题讨论】:

    标签: configuration remote-access elasticsearch-7


    【解决方案1】:

    从 ES-7 开始,在 .yml 文件中添加以下配置

    cluster.initial_master_nodes : <IP_or_DNS_of_master_node>
    

    【讨论】:

      【解决方案2】:

      从 ES7 开始,它对我有用:

      1. sudo nano /etc/elasticsearch/elasticsearch.yml

      2. 取消注释node.name

      3. network.host 更改为0.0.0.0,将discovery.seed.hosts 更改为[“127.0.0.1”],并将cluster.initial_master_nodes 更改为[“node-1”]

      4. 完成后,退出 nano,然后输入 :ctrl-x, 输入 yes

      5. sudo /bin/systemctl daemon-reload

      6. sudo /bin/systemctl enable elasticsearch.service

      7. sudo /bin/systemctl restart elasticsearch.service

      【讨论】:

        猜你喜欢
        • 2016-02-10
        • 1970-01-01
        • 2018-03-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-03
        • 1970-01-01
        相关资源
        最近更新 更多