复制 – 为什么我的solr slave索引会继续增长?

我有一个5核solr 1.4 master,使用solr复制复制到另一个5核solr,如
here所述.所有写操作都是针对master进行的,并间歇地复制到slave.这是使用以下顺序完成的:

>承诺每个主核心
>在每个从核上复制
>优化每个从核
>承诺每个奴隶核心

我遇到的问题是奴隶似乎在保留旧的索引文件并占用更多的磁盘空间.例如,在3次复制之后,主核心数据目录如下所示:

$du -sh *
145M    index

但是同一核心的从属数据目录如下所示:

$du -sh *
300M    index
144M    index.20100621042048
145M    index.20100629035801
4.0K    index.properties
4.0K    replication.properties

这是index.properties的内容:

#index properties
#Tue Jun 29 15:58:13 CDT 2010
index=index.20100629035801

和replication.properties:

#Replication details
#Tue Jun 29 15:58:13 CDT 2010
replicationFailedAtList=1277155032914
previousCycleTimeInSeconds=12
timesFailed=1
indexReplicatedAtList=1277845093709,1277155253911,1277155032914
indexReplicatedAt=1277845093709
replicationFailedAt=1277155032914
lastCycleBytesDownloaded=150616512
timesIndexReplicated=3

此从属服务器的solrconfig.xml包含默认删除策略:

[...]
<mainIndex>
    <unlockOnStartup>false</unlockOnStartup>
    <reopenReaders>true</reopenReaders>
    <deletionPolicy class="solr.SolrDeletionPolicy">
        <str name="maxCommitsToKeep">1</str>
        <str name="maxOptimizedCommitsToKeep">0</str>
    </deletionPolicy>
</mainIndex>
[...]

我错过了什么?

最佳答案 在从属上提交和优化是没用的.由于所有写操作都是在主设备上完成的,因此它是唯一可以进行这些操作的地方.

这可能是问题的原因:由于您在从属服务器上执行了额外的提交和优化,因此它会在从服务器上保留更多提交点.但这只是猜测,应该更容易理解主服务器和从服务器上的完整solrconfig.xml会发生什么.

点赞