我正在尝试创建一个具有多个内核的Solr机器。 目前,我的问题是执行初始完全导入。第一个核心完美进口。但是,当我尝试导入第二个核心时,我收到以下错误:
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/home/solr/solr/data/index/write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:84)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:602)
at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:75)
at org.apache.solr.update.SolrIndexWriter.create(SolrIndexWriter.java:62)
at org.apache.solr.update.DefaultSolrCoreState.createMainIndexWriter(DefaultSolrCoreState.java:191)
at org.apache.solr.update.DefaultSolrCoreState.getIndexWriter(DefaultSolrCoreState.java:77)
at org.apache.solr.update.DirectUpdateHandler2.addDoc(DirectUpdateHandler2.java:157)
at org.apache.solr.update.processor.RunUpdateProcessor.processAdd(RunUpdateProcessorFactory.java:61)
at org.apache.solr.update.processor.UpdateRequestProcessor.processAdd(UpdateRequestProcessor.java:51)
at org.apache.solr.update.processor.DistributedUpdateProcessor.doLocalAdd(DistributedUpdateProcessor.java:432)
at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:557)
at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd(DistributedUpdateProcessor.java:325)
at org.apache.solr.update.processor.LogUpdateProcessor.processAdd(LogUpdateProcessorFactory.java:100)
at org.apache.solr.handler.dataimport.SolrWriter.upload(SolrWriter.java:70)
at org.apache.solr.handler.dataimport.DataImportHandler$1.upload(DataImportHandler.java:233)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:507)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:411)
at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:326)
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:234)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:382)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:448)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:429)
Feb 25, 2013 11:54:30 AM org.apache.solr.handler.dataimport.DocBuilder execute
这发生在第二个核心,无论我从哪个开始。 我在这里错过了什么?每个核心都可以完美运行。
答案 0 :(得分:1)
这种情况正在发生,因为两个核心的索引目录是相同的。一旦为一个核心启动完全导入,该目录中就会有一个write.lock文件,在导入完成之前不会被删除。无论如何,您希望将核心的索引保留在不同的目录中,因此请修改solrconfig.xml,如下所示:
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication
configuration. -->
<dataDir>./data/${solr.core.name}</dataDir>