Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在SOLR 7.7中,在主服务器中禁用复制是自动从从服务器删除记录_Solr - Fatal编程技术网

在SOLR 7.7中,在主服务器中禁用复制是自动从从服务器删除记录

在SOLR 7.7中,在主服务器中禁用复制是自动从从服务器删除记录,solr,Solr,我们有1个主配置和2个从配置。所有服务器都与数百万文档同步。当我从主服务器禁用复制时,从服务器的文档将自动删除。在主服务器中,文档仍然存在,我也可以搜索。如果有人在SOLR遇到这样的问题,请帮助我。Solr4.7中的相同配置工作正常 主配置: 犯罪 启动 托管架构,stopwords.txt 从机配置: https://example.com/solr/${solr.core.name}/replication 00:00:60 更改下面的java类并重建solr solr-7.7

我们有1个主配置和2个从配置。所有服务器都与数百万文档同步。当我从主服务器禁用复制时,从服务器的文档将自动删除。在主服务器中,文档仍然存在,我也可以搜索。如果有人在SOLR遇到这样的问题,请帮助我。Solr4.7中的相同配置工作正常

主配置:


犯罪
启动
托管架构,stopwords.txt

从机配置:


https://example.com/solr/${solr.core.name}/replication
00:00:60

更改下面的java类并重建solr

solr-7.7.2\solr\core\src\java\org\apache\solr\handler\IndexFetcher.java

if (latestVersion == 0L) {
        if (forceReplication && commit.getGeneration() != 0) {
          // since we won't get the files for an empty index,
          // we just clear ours and commit
          log.info("New index in Master. Deleting mine...");
如果在solr7之后“forceReplication”条件不可用,请参见第2页。在solr 6中,存在“强制复制”。添加此条件并重新生成solr

如果您需要更多帮助,可以发表评论



也有一些可供选择的解决方案。根据您的要求,您可以选择。如果您禁用复制只是因为在每次提交到主服务器之后您不需要进行复制,那么您只能在优化调用而不是提交调用之后启用复制。在UI中,您可以禁用启用/禁用复制按钮。

在solr 8.5中也会发生同样的情况。在Solr6.6中,它工作正常,在主服务器中禁用复制时,记录不会从从属服务器中删除。我们还需要做一些配置吗,或者这是Solr7之后的一个bug。这是Solr7之后的一个bug。因此,在主从体系结构中实现禁用复制时要小心。您必须更改solr中的代码并重新生成solr。您能分享您的解决方案吗?
<lst name="slave">
    <str name="masterUrl">https://example.com/solr/${solr.core.name}/replication</str>
    <str name="pollInterval">00:00:60</str>
</lst>
if (latestVersion == 0L) {
        if (forceReplication && commit.getGeneration() != 0) {
          // since we won't get the files for an empty index,
          // we just clear ours and commit
          log.info("New index in Master. Deleting mine...");