ElasticSearch를 실행시 다음과 같은 에러가 발생할 경우가 있다.
[2019-12-31T09:28:45,708][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [localhost.localdomain] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/opt/es/elasticsearch-7.5.0/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.5.0.jar:7.5.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.5.0.jar:7.5.0]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/opt/es/elasticsearch-7.5.0/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:299) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.node.Node.(Node.java:273) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.node.Node.(Node.java:253) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:221) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:221) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.5.0.jar:7.5.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.5.0.jar:7.5.0]
... 6 more
원인은 ElasticSearch가 이미 실행중이기에 lock이 걸려있기에 문제가 발생하는 것이다
ElasticSearch 프로세스가 살아있는지 확인하고 종료후에 다시 실행하면 된다.
$ps -ef|grep elasticsearch
'빅데이터 > Elastic Search' 카테고리의 다른 글
[Elastic Search] Search API - Response (0) | 2020.01.02 |
---|---|
[Elastic Search] Search API - Request (0) | 2020.01.02 |
[Elastic Search]Java REST Client : 7.5 - Java Low Level REST Client (0) | 2019.12.27 |
[Elastic Search] 확장성 및 복원력:클러스터, 노드, 샤드(Scalability and resilience: clusters, nodes, and shards) (0) | 2019.12.20 |
[Elastic Search] 정보 출력 : 검색 및 분석 (0) | 2019.12.20 |