问题描述
我正在使用外部 Zookeper 进行测试,我在本地系统上使用的步骤如下.步骤 1. 创建了 3 个 zokeper 服务器,其中包含 myid 文件的数据,其中 myid 文件分别包含唯一编号 1,2,3.第 2 步.我使用命令
I am using external zookeper for testing I am using on local system steps I followed are as bellow.Step 1. created 3 zookeper server with data containing myid file containing unique numbers 1,2,3 respectively.Step 2. I started all three zookeper server useing command
./zkServer.sh start
步骤 3. 检查每个服务器 2 的状态,显示状态为领导者,其余 2 为模式:跟随者
Step 3. check status of each server 2 showing status as leader and remaining 2 as Mode: follower
Step4 : 尝试运行 solr cloud 示例
Step4 : try to run solr cloud example as
/opt/solr$bin/solr start -e cloud -z localhost:2181,localhost:2182,localhost:2183
它问我没有分片副本等.系统问我集合名称我输入了测试,但它抛出了像
It ask me no of shards replicas etc. System ask me collection name I entered test but it throws an exception like
`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 中显示错误异常:加载集合短语的配置名称时出错,我正在尝试创建集合测试
It showing error Exception in thread "main" org.apache.solr.client.solrj.SolrServerException: Error loading config name for collection phrases and I am trying to create collection test
推荐答案
如果您尝试使用自定义配置在 solr 云上创建集合,则必须先将其上传到 Zookeeper.然后您可以使用该配置创建一个集合.您还可以通过 solr 管理 UI (http://localhost:8983/solr/#/~cloud?view=tree).
If you are trying to create a collection on solr cloud with your custom configuration, you have to upload it first on to Zookeeper. Then you can create a collection using that config. You can also check what all configurations are there currently on the solrcloud through solr admin UI (http://localhost:8983/solr/#/~cloud?view=tree).
上传配置到zookeeper:
Uploading configuration to zookeeper:
在solr中使用zookeeper客户端(solr-6.5.1\server\scripts\cloud-scripts)
Using zookeeper client in solr (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 上创建一个集合
Now that your configuration is uploaded, you can create a collection on solrcloud
使用外部zookeeper启动solr云
start solr cloud with external zookeeper
solr start -c -z localhost:2181
创建集合
http://localhost:8983/solr/admin/collections?action=CREATE&name=<collectionname>&numShards=1&replicationFactor=1&collection.configName=<configname>
这篇关于创建集合时 Solr 云错误找不到配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!