我通過運行包含的例子bin/solr -e cloud
開始Solrcloud從Solr的雲實例飼養員,並且在這種情況下,我成功地啓動了三個節點Solr的雲和創建gettingstarted
集合:Solrj無法連接
http://localhost:8983/solr/admin/collections?action=CREATE&name=gettingstarted&numShards=3&replicationFactor=2&maxShardsPerNode=2&collection.configName=gettingstarted
我認爲它與在端口9983上運行的嵌入式動物園管理員,因爲我看到這個輸出,當我開始雲:
...
Starting up Solr on port 7574 using command:
bin/solr start -cloud -p 7574 -s "example/cloud/node2/solr" -z localhost:9983
Waiting up to 30 seconds to see Solr running on port 7574 [/]
...
然而,當我試圖連接使用SolrJ的SolrCloud時,它失敗,出現錯誤信息:
Exception in thread "main" org.apache.solr.common.SolrException: Cannot connect to cluster at localhost:9983/solr: cluster not found/not ready
誰能幫我明白這到底是怎麼回事呢?
對於任何人想知道,Zookeeper連接字符串應該包含zookeeper集羣中的所有zookeeper服務器,用逗號分隔,有些zookeeper配置使用chroot或應用程序根目錄,這是''/ solr''出現在查詢字符串的末尾。當你在Zookeeper中的''/ solr''上有一個chroot時,這將是必需的。對於大多數配置,這可以省略。 –
@BenDeMott也許這應該是一個答案? –