我正在运行一个solr云集群,并使用自定义搜索组件- 要求-消毒剂-成分。
配置:
Server count: 8
Shards: 16
Replication factor: 3
Max shards per node: 6我在solrconfig.xml中定义了搜索组件:
<searchComponent runtimeLib="true" name="request-sanitizer" version="1" class="com.cominvent.solr.RequestSanitizerComponent"/>我已经将插件jar上传到.system集合,遵循solr指南中的步骤。
然后,我使用带有以下curl的配置API将插件jar添加到我的集合中:
curl http://solr-220.soma.plos.org:8983/solr/50_2/config -H 'Content-type:application/json' -d '{
"add-runtimelib": { "name":"request-sanitizer", "version":1 }
}'然后添加搜索组件:
curl http://solr-220.soma.plos.org:8983/solr/50_2/config -H 'Content-type:application/json' -d '{
"add-searchcomponent": {
"name": "request-sanitizer",
"runtimeLib": true,
"class": "com.cominvent.solr.RequestSanitizerComponent",
"sanitize": "rows=>50:50" }
}'插件jar和搜索组件添加到configoverlay.json at http://solr-220.soma.plos.org:8983/solr/50_2/config/overlay
{
"responseHeader":{
"status":0,
"QTime":0},
"overlay":{
"znodeVersion":4,
"runtimeLib":{"request-sanitizer":{
"name":"request-sanitizer",
"version":1}},
"searchComponent":{"request-sanitizer":{
"name":"request-sanitizer",
"runtimeLib":true,
"class":"com.cominvent.solr.RequestSanitizerComponent",
"sanitize":"rows=>50:50"}}}}但是,当我试图查询集合时,会得到以下异常:
java.lang.NoClassDefFoundError: org/apache/solr/handler/component/SearchComponent
我的配置有什么问题?
Notes
在第一次尝试中,我将jar放在SOLR_HOME/lib中。这最初适用于具有少量碎片的集群--集合创建将引发相同的NoClassDefFoundError异常,但在服务器重新启动后它们将消失。
但是,当我增加到8个碎片时,创建抛出了相同的异常,集合从未创建。这就是我决定使用配置API的原因,但我也会接受使用SOLR_HOME/lib的解决方案。一种可能是强迫集合保持不变,即使有许多启动错误,如果可能的话。
感谢您的阅读!
发布于 2017-06-27 19:39:10
我们在类路径中有两个请求--消毒器jar的实例。移除其中一个罐子解决了这个问题。
https://stackoverflow.com/questions/44731455
复制相似问题