Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.
solr solr 데몬이 떠있는 동안 hadoop이 다운되는 경우 Index dir 'hdfs://mycluster/user/../core_node2/data/index/' of core 'gc_shard1_replica2' is already locked라논 오류가 발생하는데 이에 대한 조치사항
solr 데몬이 떠있는 동안 hadoop이 다운되고 hadoop을 재기동하여 서비스를 다시 시작하면 아래와 같은 오류가 발생할 수 있는데 이것은
hdfs://mycluster/user/root/solr/gc/core_node2/data/index/밑에 write.lock파일이 존재해서 발생하는 오류임.
이 파일을 지우고 solr데몬을 다시 기동하면 오류가 없이 정상적으로 서비스 가능하다.
확인 : hdfs dfs -ls hdfs://mycluster/user/root/solr/gc/core_node1/data/index
조치 : hdfs dfs -rm hdfs://mycluster/user/root/solr/gc/core_node1/data/index/write.lock
---------------오류내용---------------
Caused by: org.apache.solr.common.SolrException: Index dir 'hdfs://mycluster/user/root/solr/gc/core_node2/data/index/' of core 'gc_shard1_replica2' is already locked. The most likely cause is
another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: hdfs
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:815)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:688)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:838)
at org.apache.solr.core.CoreContainer.lambda$load$0(CoreContainer.java:494)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 more
Caused by: org.apache.lucene.store.LockObtainFailedException: Index dir 'hdfs://mycluster/user/root/solr/gc/core_node2/data/index/' of core 'gc_shard1_replica2' is already locked. The most li
kely cause is another Solr server (or another solr core in this server) also configured to use this directory; other possible causes may be specific to lockType: hdfs
at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:570)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:762)
... 8 more