簡體   English   中英

Solr - Collections API超時

[英]Solr - Collections API timeouts

我有一個3x動物園飼養員和4x solrcloud節點的設置。

這一切都正常,所有節點都相互看到,我最初有一個默認集合。

從那里開始,我使用集合API創建了一個新的集合,該集合已成功完成,並且它在2個節點上成功分片,另外2個用於副本。 我也可以成功地將文檔保存到該集合中。 在任何一個盒子上瀏覽solr web GUI都可以正常工作,沒有速度問題。

但是,無論何時我嘗試使用集合API,我都會收到超時。 創建一個新集合,重新加載一個現有集合,刪除一個集合......所有這些集合都超時。

任何關於為什么會被贊賞的想法

干杯

當Solr無法獲得群集狀態時,可能會發生此類超時。 如果跟隨調用導致超時,則情況就是這樣

http://solr-hostname:8983/solr/admin/collections?action=CLUSTERSTATUS&wt=json

這可能是由/clusterstate.json存在的錯誤條目引起的

解決這個問題:

  • 通過調用從ZooKeeper獲取clusterslate

     zkcli.sh -zkhost localhost:2181 -cmd get /clusterstate.json > clusterstate.json 
  • 編輯提取的clusterstate.json文件並刪除具有錯誤IP或不是現有主機的部分
  • 通過調用清除ZooKeeper中的clusterslate

     zkcli.sh -zkhost localhost:2181 -cmd clear /clusterstate.json 
  • 通過發送更新的JSON文件來保存ZooKeeper中的更正狀態

     zkcli.sh -zkhost localhost:2181 -cmd putfile /clusterstate.json ./clusterstate.json` 
  • 重啟Solr實例

之后,如果您的clusterstate顯示正確的信息,則訪問Collections API時不應再有超時。

注意

編輯clusterstate JSON時要小心,僅將更改限制為刪除不存在的主機/副本/分片。

我也遇到了集合API的超時問題。 為解決此問題,我將服務器的IP地址添加到您在/var/solr/data/solr.xml中找到的solr.xml文件中。 我的設置包括3台Ubuntu服務器,它們在每台服務器上運行ZooKeeper(3.4.6)和SolrCloud(5.2.1)。

我也遇到過類似的問題:

Solr process 24214 running on port 8983
Failed to get system information from http://localhost:8983/solr/ due to: org.apache.solr.client.solrj.SolrServerException: clusterstatus the collection time out:180s
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:537)
    at org.apache.solr.util.SolrCLI.getJson(SolrCLI.java:471)
    at org.apache.solr.util.SolrCLI$StatusTool.getCloudStatus(SolrCLI.java:721)
    at org.apache.solr.util.SolrCLI$StatusTool.reportStatus(SolrCLI.java:704)
    at org.apache.solr.util.SolrCLI$StatusTool.runTool(SolrCLI.java:662)
    at org.apache.solr.util.SolrCLI.main(SolrCLI.java:215)

所以為了解決這個問題,我遵循了指令並解決了它:

  • 停止所有Solr實例
  • 停止所有Zookeeper實例
  • 啟動所有Zookeeper實例
  • 一次啟動一個Solr實例。

結束了Zoo Keeper配置不匹配

暫無
暫無

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

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