Solr文件在服务器重启时丢失

时间:2015-05-17 19:31:11

标签: solr

背景:

  1. 我在Google Compute Engine上安装了Bitnami Solr图像
  2. 我有一个带有自定义架构的自定义核心
  3. 我用大约100份文件更新了核心
  4. 一切都运行良好约3周。然后我决定重新启动服务器作为日常维护的一部分。

    当我重新启动时,核心中的所有文档都消失了。核心是空的。核心配置在那里,架构配置在那里,但文档已经消失。

    我还检查了solr/mycore/data/index下的文件存储区域,那里没有多少。

    我是Solr的新手,我对它的使用相当简单,但我担心我可能做错了什么。

    有人可以告知可能是什么错误吗?

    更新

    我发现重新加载核心会导致核心中的所有文档丢失。所以我认为我可能在持久化文件方面做了一些不正确的事情

    更新2:

    进一步阅读,我发现solrconfig.xml中的autoCommit参数可能无法正确设置。所以我试着摆弄它。我将maxTime设置为1000毫秒,并将openSearcher更改为TRUE。

    完成上述操作后,我尝试通过管理控制台添加一堆文档,我收到以下错误。我现在难过!!

    auto commit error...:java.io.FileNotFoundException: /opt/bitnami/apache-solr/solr/mycore/data/index/_0.fnm (Permission denied)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at org.apache.lucene.store.FSDirectory$FSIndexOutput.<init>(FSDirectory.java:389)
        at org.apache.lucene.store.FSDirectory.createOutput(FSDirectory.java:282)
        at org.apache.lucene.store.NRTCachingDirectory.unCache(NRTCachingDirectory.java:247)
        at org.apache.lucene.store.NRTCachingDirectory.sync(NRTCachingDirectory.java:182)
        at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4528)
        at org.apache.lucene.index.IndexWriter.prepareCommitInternal(IndexWriter.java:3001)
        at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3104)
        at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3071)
        at org.apache.solr.update.DirectUpdateHandler2.commit(DirectUpdateHandler2.java:582)
        at org.apache.solr.update.CommitTracker.run(CommitTracker.java:216)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    

3 个答案:

答案 0 :(得分:0)

好吧,您似乎没有对磁盘具有写入权限。您应该检查是否允许运行Solr实例的OS用户在磁盘上写入。请注意,我对GCE一无所知,只需检查您是否有在Google提供的管理控制台中管理文件系统权限的选项。

另一种选择是将索引移动到您具有写权限的文件系统上的其他位置。

答案 1 :(得分:0)

确保您在Catalina中使用相同的solr主页没有两个vhost。我发现它在服务停止时擦除了索引。

答案 2 :(得分:0)

只是有一个类似的问题,我正在使用Cloud,请确保zookeeper / conf / zoo.cfg的dataDir设置为temp /之外的值(在许多示例中都使用了此设置)。对于许多Linux发行版,重新启动时都会删除temp。