簡體   English   中英

用於SOLR的Spring Boot運行狀況端點

[英]Spring boot health endpoint for SOLR

我使用Spring Boot嵌入式tomcat和SOLR作為虛擬示例。 在配置類中,我使用了

@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。

在調查spring boot solr運行狀況指示器類時,發現SolrHealthIndicator不使用collection

如果我缺少什么,請協助

春天啟動的SolrHealthIndicator簡單地調用ping()在你的SolrServer 目前,它無法知道應該對哪個集合執行ping操作(或者是否應該對多個集合執行ping操作)。

最好的選擇就是通過在solrServer() bean方法中調用setDefaultCollection(String)來為CloudSolrServer實例配置默認集合。

如果您希望看到SolrHealthIndicator一些增強功能(例如,允許您將集合配置為在application.properties ping),請打開一個問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM