2014-09-30 105 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