利用SOLR搭建企业搜索平台 之七(solr使用问题集)
2009-09-10 00:00:00 来源:WEB开发网某日,突发奇想,想写这么一个博客,希望记录下所有在solr中使用的毛病。而且我希望广大的看友们也能一起来说说你们平时遇到的各种错误,这样大家才能一起更好的进步!
话不多说,进入正题
1》solr 做索引时报 Lock obtain timed out: SingleInstanceLock: write.lock
有个频繁做索引的应用,它同时也对外提供搜索服务。大部分是 solr 1.3 的默认配置。solr 做索引,有时候报:
Xml代码
2009-7-13 9:48:06 org.apache.solr.common.SolrException log
严重: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SingleInstanceLock: write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:85)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1140)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:938)
at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:116)
...
是写锁取不到。但重启 solr 又可以正常做,主要是运行时间长了就报这个错了。还是看下配置吧。
看到 solr 1.3 默认的配置是:
Xml代码
<indexDefaults>
<!-- ... -->
<!--
This option specifies which Lucene LockFactory implementation to use.
single = SingleInstanceLockFactory - suggested for a read-only index
or when there is no possibility of another process trying
to modify the index.
native = NativeFSLockFactory
simple = SimpleFSLockFactory
(For backwards compatibility with Solr 1.2, 'simple' is the default
if not specified.)
-->
<lockType>single</lockType>
</indexDefaults>
更多精彩
赞助商链接