无法在Solr云上创建集合

min*_*ion 2 solr solrj solrcloud solr4

我无法在Solr Cloud中创建名为“ testCollection”的集合。

网址:: 8080 / solr / admin / collections?action = CREATE&name = testCollection

回应

<str name="Operation create caused exception:">
org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: No config set found to associate with the collection.
</str>
Run Code Online (Sandbox Code Playgroud)

根据文档:https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI)用于创建收集API,"collection.configName"不是必填字段。如果未提供,Solr将默认使用集合名称作为配置名称。

为什么我仍然面临这个问题?

是否必须使用collection.configName?

如何在Zookeeper上找到关联的collection.configName?

Jam*_*gyu 5

您仍然必须将配置集上传到Zookeeper。您可以在管理界面中cloud-> tree-> configs下的zookeeper上找到配置集列表。集合在cloud-> tree-> collections下。如果单击集合,则可以找到与其关联的配置集:({“ configName”:“ MyConfig”})

您可以在solr主机上使用zkcli.sh命令将配置集上传到zookeeper:

cd /opt/solr/server/scripts/cloud-scripts
./zkcli.sh -cmd upconfig -confdir /opt/solr/server/solr/MyCollection -confname MyConfig -z zoo1IP:2181,zoo2IP:2181,zoo3IP:2181
Run Code Online (Sandbox Code Playgroud)