在ElasticSearch中启动第二个节点时,获取错误“无法获取节点锁,尝试“

wlzqhblo  于 5个月前  发布在  ElasticSearch
关注(0)|答案(2)|浏览(104)

我只是一个学习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
Logs文件夹
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:

toe95027

toe950271#

确保node.max_local_storage_nodes参数设置为集群中的节点数(在您的案例2中)。我注意到您已经有不同的节点名称。
在Yaml,

node.max_local_storage_nodes: 2

字符串

fzsnzjdm

fzsnzjdm2#

在我的情况下,我不得不去docker上的“elastic-search”和标签“exec”,然后导航到“share/elast../data”,但它只有权限root,因为这个文件夹是由root创建的,用户“elastic”没有权限写入,所以我运行这个命令“chmod -R 777 data”,我认为这是一个快速的解决方案,但在生产模式下,也许它会得到一些问题。你可以看到更多enter link description here对不起,我的英语

相关问题