Prashant Thorat
Prashant Thorat

Reputation: 1812

Solr cloud error while creating collection no config file found

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

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

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 ` 

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

Upvotes: 2

Views: 4256

Answers (2)

Cse rvce
Cse rvce

Reputation: 73

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).

Uploading configuration to 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

Now that your configuration is uploaded, you can create a collection on solrcloud

start solr cloud with external zookeeper

solr start -c -z localhost:2181

Create collection

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

Upvotes: 1

Aneesh Mon N
Aneesh Mon N

Reputation: 696

-e cloud is an example provided by SOLR and it works with implicit ZooKeepers.

For explicit ZooKeeper implementation refer either of the below ones

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

SolrCloud 5 and Zookeeper config upload

Upvotes: 0

Related Questions