创建集合时没有找到配置文件时出现Solr云错误

时间:2015-10-30 13:02:07

标签: solr apache-zookeeper solrcloud

我正在使用外部的zookeper进行测试我正在使用的本地系统步骤我跟随的是如下。 步骤1.创建3个zookeper服务器,其中包含分别包含唯一编号1,2,3的myid文件的数据。 步骤2.我启动了所有三个zookeper服务器使用命令

./zkServer.sh start

步骤3.检查每个服务器2的状态,显示状态为领导者,剩余2为模式:跟随者

Step4:尝试运行solr cloud示例

/opt/solr$bin/solr start -e cloud -z localhost:2181,localhost:2182,localhost:2183

它问我没有碎片复制品等。系统问我收集名称我进入测试但它抛出一个例外

`basic_configs, data_driven_schema_configs, or sample_techproducts_configs [data_driven_schema_configs] 
Exception in thread "main" org.apache.solr.client.solrj.SolrServerException: Error loading config name for collection phrases
    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.getZkHost(SolrCLI.java:1160)
    at org.apache.solr.util.SolrCLI$CreateCollectionTool.runTool(SolrCLI.java:1210)
    at org.apache.solr.util.SolrCLI.main(SolrCLI.java:215)

Enabling auto soft-commits with maxTime 3 secs using the Config API

POSTing request to Config API: http://localhost:8990/solr/sai/config
{"set-property":{"updateHandler.autoSoftCommit.maxTime":"3000"}}

Exception in thread "main" org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://localhost:8990/solr: Expected mime type application/octet-stream but got text/html. <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/sai/config. Reason:
<pre>    Not Found</pre></p><hr><i><small>Powered by Jetty://</small></i><hr/>

</body>
</html>

    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:529)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:235)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:227)
    at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1220)
    at org.apache.solr.util.SolrCLI.postJsonToSolr(SolrCLI.java:1882)
    at org.apache.solr.util.SolrCLI$ConfigTool.runTool(SolrCLI.java:1856)
    at org.apache.solr.util.SolrCLI.main(SolrCLI.java:215)


SolrCloud example running, please visit http://localhost:8990/solr ` 

它在线程“main”中显示错误异常org.apache.solr.client.solrj.SolrServerException:加载集合短语的配置名称时出错,我正在尝试创建集合测试

2 个答案:

答案 0 :(得分:1)

如果您尝试使用自定义配置在solr云上创建集合,则必须先将其上载到Zookeeper。然后,您可以使用该配置创建集合。您还可以通过solr管理界面(http://localhost:8983/solr/#/~cloud?view=tree)检查solrcloud上当前的所有配置。

将配置上传到zookeeper:

在solr中使用zookeeper客户端(solr-6.5.1 \ server \ scripts \ cloud-scripts)

zkcli -zkhost <zookeeper host> -cmd upconfig -confname <configname> -solrhome <solr home directory> -confdir <config directory path>

ex: zkcli -zkhost localhost:2181 -cmd upconfig -confname sampleconfig -solrhome ../solr -confdir ../../solr/configsets/sampleconfig/conf

现在您的配置已上传,您可以在solrcloud上创建一个集合

使用外部zookeeper启动solr云

solr start -c -z localhost:2181

创建集合

http://localhost:8983/solr/admin/collections?action=CREATE&name=<collectionname>&numShards=1&replicationFactor=1&collection.configName=<configname>

答案 1 :(得分:0)

-e cloud是SOLR提供的一个示例,它与隐式ZooKeeper一起使用。

对于显式ZooKeeper实现,请参考下面的任何一个

http://amn-solr.blogspot.in/

SolrCloud 5 and Zookeeper config upload