{
"args": {
"batch": "1463743197862",
"crawlId": "sample-crawl-01",
"solr.server.url": "http:\/\/x.x.x.x:8081\/solr\/"
},
"confId": "default",
"type": "INDEX",
"crawlId": "sample-crawl-01"
}
Nutch记录:
java.lang.Exception: java.lang.RuntimeException: Missing SOLR URL. Should be set via -D solr.server.url
SOLRIndexWriter
solr.server.url : URL of the SOLR instance (mandatory)
solr.commit.size : buffer size when sending to SOLR (default 1000)
solr.mapping.file : name of the mapping file for fields (default solrindex-mapping.xml)
solr.auth : use authentication (default false)
solr.auth.username : username for authentication
solr.auth.password : password for authentication
at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
实施了吗? param传递给solr插件?
答案 0 :(得分:1)
您需要使用/config/create/
端点创建/更新配置,其中POST请求和有效负载类似于:
{
"configId":"solr-config",
"force":"true",
"params":{"solr.server.url":"http://127.0.0.1:8983/solr/"}
}
在这种情况下,我创建了一个新配置并指定了solr.server.url
参数。您可以验证这是否正在使用对/config/solr-config
的GET请求(solr-config
是先前指定的configId
),输出应包含所有默认参数,请参阅https://gist.github.com/jorgelbg/689b1d66d116fa55a1ee14d7193d71b4以获取示例/默认输出。如果返回的JSON中的一切正常,您应该看到solr.server.url
选项,其中包含所需的值https://gist.github.com/jorgelbg/689b1d66d116fa55a1ee14d7193d71b4#file-nutch-solr-config-json-L464。
在此之后只需点击/job/create
端点以创建新的INDEX
作业,有效负载应该类似于:
{
"type":"INDEX",
"confId":"solr-config",
"crawlId":"crawl01",
"args": {}
}
我们的想法是,您需要传递使用configId
创建的solr.server.url
以及crawlId
和其他参数。这应该返回类似于:
{
"id": "crawl01-solr-config-INDEX-1252914231",
"type": "INDEX",
"confId": "solr-config",
"args": {},
"result": null,
"state": "RUNNING",
"msg": "OK",
"crawlId": "crawl01"
}
您需要创建一个设置solr.server.url
的新配置,而不是通过JSON有效内容中的args
键指定它。