solr bin/snapinstaller 报 failed to connect to Solr server

昨天在用 solrj 在 solr 的子机上做索引,报错:

  1. The @Deprecated SolrUpdateServlet does not accept query parameters: /update?wt=javabin&version=2.2  
  2. If you are using solrj, make sure to register a request handler to /update rather then use this servlet.  
  3.  Add: <requestHandler name="/update" class="solr.XmlUpdateRequestHandler" > to your solrconfig.xml;  

由于 solrconfig.xml 还是旧的(solr 1.2 时候的应用),而升级了 solr 1.3 没有改 solrconfig.xml。所以出现这种的错误,还是 solrconfig.xml 打开它(没有打开它就不支持参数,是在servlet处理)。

打开后可以用 solrj 做索引了。但是今天发现 solr 子机从主机上拉的索引提交不正常,安装索引的日志显示:

command: bin/snapinstaller -u chenlb -v
installing snapshot /XXX/data/snapshot.20090414090015
notifing Solr to open a new Searcher
failed to connect to Solr server
snapshot installed but Solr server has not open a new Searcher

而用 solr 1.3 带的post.sh例子里的commit命令没有问题,再打开 bin/commit 与 post.sh 里对比下,发现bin/commit 没有

-H 'Content-type:text/xml; charset=utf-8'

说明它也是旧的,在 solrconfig.xml 的 /update 的注释可以看到提示。

把 bin/commit 修改,加上 curl -H 的内容,可以正常提交,但还是有 failed to connect to Solr server 的错误日志。

解决方法:

1、bin目录下的,与 conf 目录下的全换上 solr 1.3 版的。

2、在 solrconfig.xml 关闭 /update,也即还是用旧的。子机没所为, 都不用 solrj 去提交索引(是拉主机的索引)
posted @ 2009-09-16 12:14  searchDM  阅读(345)  评论(0编辑  收藏  举报