在弹性搜索中启动第二个节点时遇到错误“未能获取节点锁,已尝试”

时间:2018-11-05 15:31:33

标签: elasticsearch

我只是学习弹性搜索的初学者,并开始在Windows 10框中设置2节点群集。

我已根据论坛和文章配置了两个节点。

但是,我能够启动第一个节点,但是当启动第二个节点时,它将引发错误。

[2018-11-05T16:07:31,935][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [elastic_search_node_02] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Elastic_search_cluster\data\elastic_search_cluster]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?

以下是两个节点的设置,

节点1目录

C:\Elastic_search_cluster\elasticsearch-6.4.2_node01\

节点2目录

C:\Elastic_search_cluster\elasticsearch-6.4.2_node02\

数据文件夹

C:\ Elastic_search_cluster \ data \

日志文件夹

C:\ Elastic_search_cluster \ logs \

节点1配置

cluster.name: elastic_search_cluster
node.name: elastic_search_node_01
node.master: true
node.data: true
path.data: C:\Elastic_search_cluster\data\
path.logs: C:\Elastic_search_cluster\logs\
network.host: localhost
http.port: 9200

节点2配置

cluster.name: elastic_search_cluster
node.name: elastic_search_node_02
node.master: false
node.data: true
path.data: C:\Elastic_search_cluster\data\
path.logs: C:\Elastic_search_cluster\logs\
network.host: localhost
http.port: 9201

请提供有关配置或任何其他建议的建议。每个节点的数据和日志文件夹路径是否需要分开。

我是否需要设置其他如下参数?

discovery.zen.ping.unicast.hosts:
discovery.zen.minimum_master_nodes: 

1 个答案:

答案 0 :(得分:3)

确保将node.max_local_storage_nodes参数设置为本地集群中的节点数(在您的情况2中)。我注意到您已经拥有不同的节点名称。

以yaml表示,

<div class="wrap">

  <div class="containerchid">
    <div class="child"></div>
    <div class="child"></div>
    <div class="child"></div>
  </div>
    <div class="parent"></div>
</div>