【问题标题】:Solr indexversion and replicatable index version are differentSolr indexversion 和可复制索引版本不同
【发布时间】:2012-09-07 14:16:14
【问题描述】:

我正在使用 solrJ 将文档添加到 solr 服务器。 我有一个主/从设置。建立索引后,我通过http://URL/update?commit=true 进行提交,以便能够在主节点中进行搜索。但是对于复制,当我使用 replication?command=details 查看 indexversion 详细信息时,我看到 indexverion 和可复制索引版本是不同的。

`<arr name="commits">
<lst>
<long name="indexVersion">1346928051888</long>
<long name="generation">1907</long>
<arr name="filelist"></arr>
</lst>
</arr>
<str name="isMaster">true</str>
<str name="isSlave">false</str>
<long name="indexVersion">1346928051888</long>
<long name="generation">1907</long>
<lst name="master"><arr name="replicateAfter"><str>commit</str>
<str>startup</str></arr>
<str name="replicationEnabled">true</str>
<long name="replicatableIndexVersion">1346928046763</long>
<long name="replicatableGeneration">1</long></lst>
</lst>`

Because of this the slave is not replicating the commited document.


Here is the code i used for solrJ to add documents
Collection<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
SolrInputDocument doc = new SolrInputDocument();
doc.add(FIELDS);
docs.add(doc);

SolrInputDocument doc = new SolrInputDocument();
doc.add(FIELDS);
docs.add(doc);

SolrInputDocument doc = new SolrInputDocument();
doc.add(FIELDS);
docs.add(doc);

server.add(docs);
server.commit();

我在这里有什么遗漏吗?非常感谢任何帮助。谢谢

【问题讨论】:

    标签: solr replication solrj master slave


    【解决方案1】:

    我会尽量避免在提交和启动后将复制放在一起。它导致了一些问题 仅在提交后尝试复制。

    <requestHandler name="/replication" class="solr.ReplicationHandler" >
        <lst name="master">
    
            <str name="replicateAfter">commit</str>     
            <str name="confFiles">schema.xml,stopwords.txt,elevate.xml</str>
            <str name="commitReserveDuration">00:00:10</str>
        </lst>
         <str name="maxNumberOfBackups">1</str> 
    </requestHandler>
    

    它是这样工作的吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-20
      • 2012-08-20
      • 1970-01-01
      • 1970-01-01
      • 2014-10-07
      • 2011-03-21
      • 1970-01-01
      • 2012-05-16
      相关资源
      最近更新 更多