创建集合时找不到Solr云错误,找不到配置文件 [英] Solr cloud error while creating collection no config file found

查看:90
本文介绍了创建集合时找不到Solr云错误,找不到配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用外部Zookeper进行测试,在本地系统上使用的步骤如下.步骤1.使用包含myid文件的数据创建3个zookeper服务器,其中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开始

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

Step 3. check status of each server 2 showing status as leader and remaining 2 as Mode: follower

Step4:尝试以

/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管理员用户界面( 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(solr-6.5.1 \ server \ scripts \ cloud-scripts)中使用Zookeeper客户端

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 Cloud

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云错误,找不到配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆