solr 做索引时报 Lock obtain timed out: SingleInstanceLock: write.lock

有个频繁做索引的应用,它同时也对外提供搜索服务。大部分是 solr 1.3 的默认配置。solr 做索引,有时候报:

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 默认的配置是:

  1. <indexDefaults>  
  2.     <!-- ... -->  
  3.     <!--  
  4.       This option specifies which Lucene LockFactory implementation to use.  
  5.   
  6.       single = SingleInstanceLockFactory - suggested for a read-only index  
  7.                or when there is no possibility of another process trying  
  8.                to modify the index.  
  9.       native = NativeFSLockFactory  
  10.       simple = SimpleFSLockFactory  
  11.   
  12.       (For backwards compatibility with Solr 1.2, 'simple' is the default  
  13.        if not specified.)  
  14.     -->  
  15.     <lockType>single</lockType>  
  16. </indexDefaults>  
<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> 

默认锁是 single ,只读的。solr 1.2 是 simple,把它改回去了,运行了几天,没事。

转载于:https://www.cnblogs.com/wycg1984/archive/2009/09/16/1567641.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值