zoukankan      html  css  js  c++  java
  • 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>  

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

  • 相关阅读:
    转载:c++内存泄露机制
    推荐一款不错的dialog小工具:artDialog
    写的一些推广方法 拿出来分享下
    struts2标签具体解释
    父亲节:再见,总有一天
    Hadoop是什么
    熊猫烟花集团完美见证异速联远程接入系统
    OpenStack Networking
    管道(Pipe)/createPipe
    百度2014校园招聘算法——给出一组数据A=[a_0, a_1, a-2, ... a_n](当中n可变),打印出该数值元素的全部组合。
  • 原文地址:https://www.cnblogs.com/wycg1984/p/1567641.html
Copyright © 2011-2022 走看看