【问题标题】:solr ReplicationHandler - SnapPull failed to download filessolr ReplicationHandler - SnapPull 无法下载文件
【发布时间】:2013-10-30 18:35:49
【问题描述】:

在从主服务器复制到从服务器期间,我们不断收到此异常。 我们的索引大小是 9.7 G,我们正在尝试从头开始复制一个从站。

2013 年 10 月 30 日 18:22:16,996 [explicit-fetchindex-cmd] 错误 ReplicationHandler - SnapPull 失败:org.apache.solr.common.SolrException:无法完全下载 _41c_Lucene41_0.doc。已下载 0!=107464871 在 org.apache.solr.handler.SnapPuller$DirectoryFileFetcher.cleanup(SnapPuller.java:1266) 在 org.apache.solr.handler.SnapPuller$DirectoryFileFetcher.fetchFile(SnapPuller.java:1146) 在 org.apache.solr.handler.SnapPuller.downloadIndexFiles(SnapPuller.java:741) 在 org.apache.solr.handler.SnapPuller.fetchLatestIndex(SnapPuller.java:405) 在 org.apache.solr.handler.ReplicationHandler.doFetch(ReplicationHandler.java:319) 在 org.apache.solr.handler.ReplicationHandler$1.run(ReplicationHandler.java:220)

我在某个线程中读到 solr 4.1 中存在相关错误,但我们使用的是 solr 4.3 并尝试使用 4.5.1。 有时DirectoryFileFetcher无法下载文件,文件被下载到大小为零的salve。

这是主设置:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
   <lst name="master">
     <str name="replicateAfter">commit</str>
     <str name="replicateAfter">startup</str>
     <str name="confFiles">stopwords.txt,spellings.txt,synonyms.txt,protwords.txt,elevate.xml,currency.xml</str>
     <str name="commitReserveDuration">00:00:50</str>
   </lst>
</requestHandler>

和从站设置:

<requestHandler name="/replication" class="solr.ReplicationHandler" >
   <lst name="master">
     <str name="replicateAfter">commit</str>
     <str name="replicateAfter">startup</str>
     <str name="confFiles">stopwords.txt,spellings.txt,synonyms.txt,protwords.txt,elevate.xml,currency.xml</str>
     <str name="commitReserveDuration">00:00:50</str>
   </lst>
</requestHandler>

【问题讨论】:

    标签: solr replication solrj solrcloud


    【解决方案1】:

    问题似乎出在 httpclient 上。 我为所有库打开了调试日志记录,并在失败前看到来自 httpclient 的消息“响应垃圾”。

    这是一个日志 sn-p:

    31 Oct 2013 18:10:40,360 [explicit-fetchindex-cmd] DEBUG DefaultClientConnection - Sending request: GET /solr-master/replication?comman
    

    d=filecontent&generation=6814&qt=%2Freplication&file=_aa7_Lucene41_0.pos&checksum=true&wt=filestream HTTP/1.1 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - >> "GET /solr-master/replication?command=filecontent&generation=6814&qt =%2Freplication&file=_aa7_Lucene41_0.pos&checksum=true&wt=filestream HTTP/1.1[\r][\n]" 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - >> “用户代理:Solr [org.apache.solr.client.solrj.impl.HttpSolrServer] 1.0[\r][\n]" 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - >> “主机:solr-master.saltdev.sealdoc.com:8081[\r][\n]” 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - >> “连接:保持活动 [\r][\n]” 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - >> “[\r][\n]” 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试标头 - >> GET /solr-master/replication?command=filecontent&generation=6814& qt=%2Freplication&file=_aa7_Lucene41_0.pos&checksum=true&wt=filestream HTTP/1.1 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] DEBUG headers - >> User-Agent: Solr[org.apache.solr.client.solrj.impl.HttpSolrServer ] 1.0 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试标头 - >> 主机:solr-master.saltdev.sealdoc.com:8081 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试头 - >> 连接:保持活动 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试 DefaultHttpResponseParser - 垃圾响应: 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试 DefaultHttpResponseParser - 垃圾响应:4 2013 年 10 月 31 日 18:10:40,361 [explicit-fetchindex-cmd] 调试线 - 172.16.77.121:8081 已关闭 2013 年 10 月 31 日 18:10:40,398 [explicit-fetchindex-cmd] 调试 DefaultClientConnection - 连接 0.0.0.0:55266172.16.77.121:8081 关闭 2013 年 10 月 31 日 18:10:40,398 [explicit-fetchindex-cmd] 调试 DefaultClientConnection - 连接 0.0.0.0:55266172.16.77.121:8081 已关闭 2013 年 10 月 31 日 18:10:40,398 [explicit-fetchindex-cmd] DEBUG PoolingClientConnectionManager - 连接已发布:[id: 0][route: {}->http://solr-master.saltdev.sealdoc.com:8081][存活总数:1;分配的路线:10000 条;总分配:1 of 10000] 2013 年 10 月 31 日 18:10:40,425 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 发布目录:/opt/watchdox/solr-slave/data/index 2 false 2013 年 10 月 31 日 18:10:40,425 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 重用缓存目录:CachedDir 2013 年 10 月 31 日 18:10:40,425 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 发布目录:/opt/watchdox/solr-slave/data 0 false 2013 年 10 月 31 日 18:10:40,425 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 重用缓存目录:CachedDir 2013 年 10 月 31 日 18:10:40,427 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 发布目录:/opt/watchdox/solr-slave/data 0 false 2013 年 10 月 31 日 18:10:40,428 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 使用目录完成:CachedDir 2013 年 10 月 31 日 18:10:40,428 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 发布目录:/opt/watchdox/solr-slave/data/index.20131031180837277 0 true 2013 年 10 月 31 日 18:10:40,428 [explicit-fetchindex-cmd] INFO CachingDirectoryFactory - 正在寻找关闭 /opt/watchdox/solr-slave/data/index.20131031180837277 [CachedDir] 2013 年 10 月 31 日 18:10:40,428 [explicit-fetchindex-cmd] INFO CachingDirectoryFactory - 关闭目录:/opt/watchdox/solr-slave/data/index.20131031180837277 2013 年 10 月 31 日 18:10:40,428 [explicit-fetchindex-cmd] INFO CachingDirectoryFactory - 在核心关闭之前删除目录:/opt/watchdox/solr-slave/data/index.20131031180837277 2013 年 10 月 31 日 18:10:40,878 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 从缓存中删除:CachedDir 2013 年 10 月 31 日 18:10:40,878 [explicit-fetchindex-cmd] DEBUG CachingDirectoryFactory - 发布目录:/opt/watchdox/solr-slave/data/index 1 false 2013 年 10 月 31 日 18:10:40,879 [explicit-fetchindex-cmd] 错误 ReplicationHandler - SnapPull 失败:org.apache.solr.common.SolrException:无法完全下载 _aa7_Lucene41_0.pos。已下载 0!=1081710 在 org.apache.solr.handler.SnapPuller$DirectoryFileFetcher.cleanup(SnapPuller.java:1212) 在 org.apache.solr.handler.SnapPuller$DirectoryFileFetcher.fetchFile(SnapPuller.java:1092) 在 org.apache.solr.handler.SnapPuller.downloadIndexFiles(SnapPuller.java:719) 在 org.apache.solr.handler.SnapPuller.fetchLatestIndex(SnapPuller.java:397) 在 org.apache.solr.handler.ReplicationHandler.doFetch(ReplicationHandler.java:317) 在 org.apache.solr.handler.ReplicationHandler$1.run(ReplicationHandler.java:218)

    2013 年 10 月 31 日 18:10:40,910 [http-bio-8080-exec-8] 调试 CachingDirectoryFactory - 重用缓存目录:CachedDir

    所以我将 httpcomponents jar 升级到最新的 4.3.x 版本,问题就消失了。 httpcomponents jars 是 solrj 的依赖项,在 4.2.x 版本中,我升级到 httpclient-4.3.1 、 httpcore-4.3 和 httpmime-4.3.1 我现在运行了几次复制,完全没有问题,它现在按预期工作。 似乎只有从属端需要升级,但我也要升级主控端。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-29
      • 2014-03-23
      • 2013-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多