Hari
Hari

Reputation: 511

getting error " failed to obtain node locks, tried " when starting second node in elastic search

I am just a beginner in learning elastic search and started to setup 2 node cluster on windows 10 box.

I have configured the two nodes based on the forums and articles.

However, I am able to start the first node but when starting the second node, it throws an error.

[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])?

The following is the setup for both the nodes,

Node 1 dir

C:\Elastic_search_cluster\elasticsearch-6.4.2_node01\

Node 2 dir

C:\Elastic_search_cluster\elasticsearch-6.4.2_node02\

Data folder

C:\Elastic_search_cluster\data\

Logs folder

C:\Elastic_search_cluster\logs\

Node 1 configuration

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

Node 2 configuration

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

Please advise on the configuration or any other recommendation. Does the data and logs folder path need to be separate for each node.

Do i need to set other parameters like the below ?

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

Upvotes: 2

Views: 8430

Answers (2)

Jonatan Pacheco
Jonatan Pacheco

Reputation: 1

In my case, I had to go to docker on "elastic-search" and tab "exec" and then navigated to "share/elast../data", but it only have permission root, because this folder was created by root, and the user "elastic" not have permision to write, so I run this command "chmod -R 777 data", I think its a fast solution but in production mode maybe it will get some problems. You can see more enter link description here Sorry by my english

Upvotes: 0

Nirmal
Nirmal

Reputation: 1336

Make sure node.max_local_storage_nodes param is set to # of nodes in cluster locally ( In your case 2 ) . I notice that you already have node names different.

in yaml ,

node.max_local_storage_nodes: 2

Upvotes: 3

Related Questions