用卷曲重新加载Solr核心

时间:2012-07-18 11:37:07

标签: curl solr reload core

我试图通过以下句子重新加载Solr核心(版本3.6.0):

curl http://localhost:8983/solr/admin/cores?action=RELOAD\&core=mycore

当我执行它时,我收到以下响应:

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <lst name="responseHeader">
      <int name="status">0</int>
      <int name="QTime">1316</int>
   </lst>
</response>

当我将这样的URL放在我的浏览器上时,我得到了类似的响应(区别在于QTime的值)。

我的问题是,如果我从浏览器调用URL,我可以在日志信息中看到重载已执行,但是如果我从CURL语句调用它,我就看不到任何东西了日志信息(也就是说,没有执行重载过程)。

我是否需要更改一些配置数据?似乎呼叫没有到达Solr服务器...

2 个答案:

答案 0 :(得分:14)

尝试使用双引号将URL括在命令中,如下所示:

curl "http://localhost:8983/solr/admin/cores?action=RELOAD&core=mycore"

希望这有帮助

答案 1 :(得分:4)

1.尝试使用-A指定User-Agent

curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" http://localhost:8983/solr/admin/cores?action=RELOAD\&core=mycore

2.Curl不能执行js脚本

因此请确保它不是因为js脚本。

您可以使用chrome或Firebug + Firefox的开发者工具来检查http通信过程。

3.使用wireshark或某人检查“呼叫是否到达Solr服务器”。

我希望有所帮助。