solr ReplicationHandler-SnapPull无法下载文件



在从主服务器到从服务器的复制过程中,我们不断地遇到此异常。我们的索引大小是9.7G,我们正试图从头开始复制一个slave。

2013年10月30日18:22:16996[explicit fetchindex cmd]ERROR ReplicationHandler-SnapPull失败:org.apache.solr.common.SolrException:无法完全下载_41c_Luce41_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有时无法下载文件,文件被下载到大小为零的托盘。

这是主设置:

<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>

问题似乎出在httpclient上。我打开了所有库的调试日志记录,并在失败前看到httpclient发出的消息"Garbage in response"。

这是一个日志片段:

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

d=文件内容&生成=6814&qt=%2复制&file=_aa7_Lucene41_0.pos&校验和=真&wt=文件流HTTP/1.12013年10月31日18:10:40361〔显式fetchindex cmd〕调试连线->>"GET/solr master/replication"command=filecontent&generation=6814&qt=%2复制&file=_aa7_Lucene41_0.pos&校验和=真&wt=文件流HTTP/1.1[\r][n]"2013年10月31日18:10:40361[显式fetchindex cmd]调试连线->>"用户代理:Solr[org.apache.Solr.client.solrj.impl.HttpSolrServer]1.0[\r][\n]"2013年10月31日18:10:40361[explicit fetchindex cmd]DEBUG wire->>"主机:solr master.saltdev.sealdoc.com:8081[\r][n]"2013年10月31日18:10:40361[显式fetchindex cmd]调试连线->>"连接:保持活动状态[\r][n]"2013年10月31日18:10:40361[显式fetchindex cmd]调试连线->>"[\r][n]"2013年10月31日18:10:40361〔显式fetchindex cmd〕调试头->>GET/solr master/replication?command=文件内容&生成=6814&qt=%2复制&file=_aa7_Lucene41_0.pos&校验和=真&wt=文件流HTTP/1.12013年10月31日18:10:40361[显式fetchindex cmd]调试头->>用户代理:Solr[org.apache.Solr.client.solrj.impl.HttpSolrServer]1.02013年10月31日18:10:40361[显式fetchindex cmd]调试头->>主机:solr master.saltdev.sealtdoc.com:80812013年10月31日18:10:40361〔显式fetchindex cmd〕调试标头->>连接:保持活动2013年10月31日18:10:40361[显式fetchindex cmd]调试连线-<lt;"[\r][\n]">2013年10月31日18:10:40361[显式fetchindex cmd]DEBUG DefaultHttpResponseParser-响应中的垃圾:1013年10日31日18:10:00 40361[隐式fetchindex cmd]DEBUG wire-<lt;"4[\r][\n]">2013年10月31日18:10:40361[explicit fetchindex cmd]DEBUG DefaultHttpResponseParser-垃圾响应:4<"[0x0][0x0][0x0][x0][0x0]\r\n]"2013年10月31日18:10:40361〔显式fetchindex cmd〕DEBUG DefaultHttpResponseParser-垃圾响应:^@^@^@^@2013年10月31日18:10:40361[显式fetchindex cmd]调试连线-<lt;"0[\r][\n]"2013年10月31日18:10:40361〔显式fetchindex cmd〕DEBUG DefaultHttpResponseParser-垃圾响应:02013年10月31日18:10:40361[显式fetchindex cmd]调试连线-<lt;"[\r][\n]"2013年10月31日18:10:40361〔显式fetchindex cmd〕DEBUG DefaultHttpResponseParser-垃圾响应:2013年10月31日18:10:40398[显式fetchindex cmd]调试DefaultClientConnection-连接0.0.0.0:55266<->172.16.77.121:8081关闭2013年10月31日18:10:40398[显式fetchindex cmd]调试DefaultClientConnection-连接0.0.0.0:55266<->172.16.77.121:8081关闭2013年10月31日18:10:40398[显式fetchindex cmd]调试DefaultClientConnection-连接0.0.0.0:55266<->172.16.77.121:8081关闭2013年10月31日18:10:40398[显式fetchindex cmd]调试池ClientConnectionManager-连接已发布:[id:0][路由:{}->http://solr-master.saltdev.sealdoc.com:8081][保持活动的总数:1;分配的路由:万分之一;分配的总数:万分之一]2013年10月31日18:10:40425〔explicit fetchindex cmd〕DEBUG CachingDirectoryFactory-发布目录:/opt/watchdox/solr slave/data/index 2 false2013年10月31日18:10:40425〔显式fetchindex cmd〕调试CachingDirectoryFactory-重用缓存目录:CachedDir<>2013年10月31日18:10:40425〔explicit fetchindex cmd〕DEBUG CachingDirectoryFactory-发布目录:/opt/watchdox/solr slave/data 0 false2013年10月31日18:10:40425〔显式fetchindex cmd〕调试CachingDirectoryFactory-重用缓存目录:CachedDir<>2013年10月31日18:10:40427〔explicit fetchindex cmd〕DEBUG CachingDirectoryFactory-发布目录:/opt/watchdox/solr slave/data 0 false2013年10月31日18:10:40428〔显式fetchindex cmd〕调试CachingDirectoryFactory-完成目录:CachedDir<>2013年10月31日18:10:40428〔explicit fetchindex cmd〕DEBUG CachingDirectoryFactory-发布目录:/opt/watchdox/solr-slave/data/index.20131031180832777 0 true2013年10月31日18:10:40428[explicit fetchindex cmd]INFO CachingDirectoryFactory-希望关闭/opt/watchdox/solr-slave/data/index.20131031180832777[CachedDir<>]2013年10月31日18:10:40428〔explicit fetchindex cmd〕INFO CachingDirectoryFactory-关闭目录:/opt/watchdox/solr-slave/data/index.20131031180832772013年10月31日18:10:40428〔explicit fetchindex cmd〕INFO CachingDirectoryFactory-在核心关闭前删除目录:/opt/watchdox/solr-slave/data/index.20131031180832772013年10月31日18:10:40878〔显式fetchindex cmd〕调试CachingDirectoryFactory-从缓存中删除:CachedDir<>2013年10月31日18:10:40878〔explicit fetchindex cmd〕DEBUG CachingDirectoryFactory-发布目录:/opt/watchdox/solr slave/data/index 1 false2013年10月31日18:10:40879[explicit fetchindex cmd]ERROR ReplicationHandler-SnapPull失败:org.apache.solr.common.SolrException:无法完全下载_aa7_Lucine41_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:40910[http-bio-8080-exec-8]调试CachingDirectoryFactory-重用缓存目录:CachedDir<>

因此,我将httpcomponents-jar升级到了最新的4.3.x版本,问题就消失了。httpcomponents-jar是solrj的依赖项,在4.2.x版本中,我升级到了httpclient-4.3.1、httpcore-4.3和httpmime-4.31我现在运行了几次复制,没有任何问题,它现在可以按预期工作了。它接缝升级是必要的,只有在从属方面,但我也要升级主。

最新更新