2015-10-30 51 views
1

我正在使用外部zookeper进行测试我在本地系统上使用的步骤如下所示。 第1步创建了3个zookeper服务器,其中包含分别包含唯一编号1,2,3的myid文件的数据。 第2步。我一开始所有三个zookeper服务器期运用命令Solr创建集合时发现错误无配置文件

./zkServer.sh start

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

第四步:尝试运行Solr的云实例作为

/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 ` 

它显示线程“主要” org.apache.solr.client.solrj.SolrServerException错误例外:收集短语加载配置时出错的名字,我想创建收集测试

回答

0

任如果你想创建Solr的云收集您的自定义配置,你必须先上传对Zookeeper。然后你可以使用该配置创建一个集合。您还可以通过solr管理界面(http://localhost:8983/solr/#/~cloud?view=tree)查看solrcloud当前所有配置。

上传配置饲养员:

Solr中使用饲养员客户端(Solr的-6.5.1 \服务器\脚本\云的脚本)

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

开始Solr的云收集与外部饲养员

solr start -c -z localhost:2181 

创建集合

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