【问题标题】:why Elasticsearch still complains about bootstrap checks failed为什么 Elasticsearch 仍然抱怨引导检查失败
【发布时间】:2019-10-24 07:02:46
【问题描述】:

在 Ubuntu 18.04 上安装了 ElasticSearch 7.3.0。能够在开发模式下启动它。现在我想从另一台机器远程连接到ES,所以我更改了elasticsearch.yml中的配置并尝试在生产模式下启动它(尽管仍然只有一个ES机器)。下面是我的 elasticsearch.yml 文件:

但是,每次我运行 'sudo systemctl start elasticsearch.service' 命令后,elasticsearch 都会给我这个警告“默认发现设置不适合生产使用:至少一个 [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] 必须配置”。

正如您在第一张图片中看到的,我确实正确配置了 cluster.initial_master_nodes。那么我在这里错过了什么?

---更新------------------------------- -------------------------------------------------- ----------------------

我刚刚意识到无论我尝试重新启动elasticsearch服务多少次,由于某种原因它没有更新日志文件。如您所见,最后一条日志的时间戳是 2019-08-10,也就是昨天。我很确定我今天早上重启了几次服务,今天是 2019-08-11。附言我在 UTC-8 时区。

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    我解决了这个问题。

    编辑 elasticsearch.yml

    进行以下更改/更新:

    1. 集群部分 - 取消注释 cluster.name:
    2. 为集群命名。我命名了我的 ELK,但你可以使用任何你想命名的集群。 注意:您无需在技术上运行集群即可使其正常工作...
    3. 节点部分 - 取消注释 node.name: & cluster.initial_master_nodes:
    4. 为节点命名。我命名了我的 ES1,但您可以使用任何您想要命名的节点。
    5. 发现主机部分 - 取消注释 discovery.seed_hosts:
    6. 输入节点名称。我为两个订单项输入了 ["ES1"]。
    7. 保存配置文件
    8. 启动 elasticsearch.service

    【讨论】:

      【解决方案2】:

      user1496433 的回答有效。这是完整的 yml 文件,以防它对任何人都有帮助:

      # ======================== Elasticsearch Configuration =========================
      #
      # NOTE: Elasticsearch comes with reasonable defaults for most settings.
      #       Before you set out to tweak and tune the configuration, make sure you
      #       understand what are you trying to accomplish and the consequences.
      #
      # The primary way of configuring a node is via this file. This template lists
      # the most important settings you may want to configure for a production cluster.
      #
      # Please consult the documentation for further information on configuration options:
      # https://www.elastic.co/guide/en/elasticsearch/reference/index.html
      #
      # ---------------------------------- Cluster -----------------------------------
      #
      # Use a descriptive name for your cluster:
      #
      cluster.name: dev-logs
      #
      # ------------------------------------ Node ------------------------------------
      #
      # Use a descriptive name for the node:
      #
      node.name: dev-logs-1
      #
      # Add custom attributes to the node:
      #
      #node.attr.rack: r1
      #
      # ----------------------------------- Paths ------------------------------------
      #
      # Path to directory where to store the data (separate multiple locations by comma):
      #
      #path.data: /path/to/data
      #
      # Path to log files:
      #
      #path.logs: /path/to/logs
      #
      # ----------------------------------- Memory -----------------------------------
      #
      # Lock the memory on startup:
      #
      #bootstrap.memory_lock: true
      #
      # Make sure that the heap size is set to about half the memory available
      # on the system and that the owner of the process is allowed to use this
      # limit.
      #
      # Elasticsearch performs poorly when the system is swapping the memory.
      #
      # ---------------------------------- Network -----------------------------------
      #
      # Set the bind address to a specific IP (IPv4 or IPv6):
      #
      network.host: 0.0.0.0
      #
      # Set a custom port for HTTP:
      #
      http.port: 9400
      #
      http.cors.enabled: true
      http.cors.allow-origin: "*"
      http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE
      http.cors.allow-headers: "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization"
      # For more information, consult the network module documentation.
      #
      # --------------------------------- Discovery ----------------------------------
      #
      # Pass an initial list of hosts to perform discovery when this node is started:
      # The default list of hosts is ["127.0.0.1", "[::1]"]
      #
      discovery.seed_hosts: ["dev-logs-1"]
      #
      # Bootstrap the cluster using an initial set of master-eligible nodes:
      #
      cluster.initial_master_nodes: ["dev-logs-1"]
      #
      # For more information, consult the discovery and cluster formation module documentation.
      #
      # ---------------------------------- Gateway -----------------------------------
      #
      # Block initial recovery after a full cluster restart until N nodes are started:
      #
      #gateway.recover_after_nodes: 3
      #
      # For more information, consult the gateway module documentation.
      #
      # ---------------------------------- Various -----------------------------------
      #
      # Require explicit names when deleting indices:
      #
      #action.destructive_requires_name: true
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-01-14
        • 2023-03-16
        • 1970-01-01
        • 2021-05-01
        • 1970-01-01
        • 2015-06-09
        相关资源
        最近更新 更多