2014-09-30 102 views
1

我使用Spring引导嵌入式tomcat和SOLR作为例子。 在我的配置类我已经使用SOLR的Spring引导健康端点

@Bean 
public CloudSolrServer solrServer(){ 
    return new CloudSolrServer(zkEnsemble); 
} 

同时击中低于健康URL的消息我得到。

 

{ 
    "status" : { 
    "status" : "DOWN" 
    }, 
    "details" : { 
    "error" : "org.apache.solr.client.solrj.SolrServerException: No collection param specified on request and no default collection has been set." 
    }, 
    "error" : "org.apache.solr.client.solrj.SolrServerException: No collection param specified on request and no default collection has been set." 
} 
 

您能否协助我,我该如何删除此消息,以便状态为UP。

在调查春天启动Solr的健康指标类,它被发现,SolrHealthIndicator不使用收集

请帮助,如果我失去了一些东西

+0

Solr bean是否已正确初始化,或者根本不工作? – Vaelyr 2014-09-30 17:51:39

+0

它看起来像你配置的Solr是错误的。你需要云功能吗?我建议尝试与基地HttpSolrServer – Mysterion 2014-10-01 07:59:10

回答

0

春天启动的SolrHealthIndicator只需在您的通话SolrServerping()。目前,它无法知道应该ping哪个集合(或者应该ping多个集合)。

刚才您的最佳选择是通过在您的solrServer() bean方法中调用setDefaultCollection(String)来将CloudSolrServer实例配置为默认集合。

如果您希望看到SolrHealthIndicator的一些增强功能,例如您可以配置集合在application.properties中进行ping操作,请open an issue