Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Not able create SOLR COLLECTION NAMED

Guru

Team,

I am getting below error when I am trying to create collection,So can you please help me to solve it.

[root@sandbox ~]# /opt/lucidworks-hdpsearch/solr/bin/solr create -c labs -d /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf/ -n labs -s 1 -rf 1

Connecting to ZooKeeper at sandbox.hortonworks.com:2181

Re-using existing configuration directory labs

Creating new collection 'labs' using command:

http://172.16.162.136:8983/solr/admin/collections?action=CREATE&name=labs&numShards=1&replicationFac...

{

"responseHeader":{

"status":0,

"QTime":1136},

"failure":{"":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://172.16.162.136:8983/solr: Error CREATEing SolrCore 'labs_shard1_replica1': Unable to create core [labs_shard1_replica1] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/configs/labs', cwd=/opt/lucidworks-hdpsearch/solr/server"}}

I am following up following reference url :

http://hortonworks.com/hadoop-tutorial/searching-data-solr/

1 ACCEPTED SOLUTION

Super Collaborator

It's telling you that it cannot find the file in your confdir (the directory after -d in your command). Do an ls on the directory and either the directory is missing or the solrconfig.xml is missing from /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf. You may have overlooked a step in the setup (Step 2). It includes creating the conf directory and modifying the solrconfig.xml file...

cp -R /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs

View solution in original post

5 REPLIES 5

Super Collaborator

It's telling you that it cannot find the file in your confdir (the directory after -d in your command). Do an ls on the directory and either the directory is missing or the solrconfig.xml is missing from /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf. You may have overlooked a step in the setup (Step 2). It includes creating the conf directory and modifying the solrconfig.xml file...

cp -R /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs

Guru
@james.jones

I followed all steps and changed solrconfig.xml file as well. But still getting below error.

[solr@sandbox ~]$ /opt/lucidworks-hdpsearch/solr/bin/solr create -c labs -d /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf -n labs -s 2 -rf 2

Connecting to ZooKeeper at sandbox.hortonworks.com:2181

Re-using existing configuration directory labs

Creating new collection 'labs' using command:

http://172.16.162.136:8983/solr/admin/collections?action=CREATE&name=labs&numShards=2&replicationFac...

{

"responseHeader":{

"status":0,

"QTime":1284},

"failure":{"":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://172.16.162.136:8983/solr: Error CREATEing SolrCore 'labs_shard1_replica2': Unable to create core [labs_shard1_replica2] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/configs/labs', cwd=/opt/lucidworks-hdpsearch/solr/server"}}

[solr@sandbox ~]$ ll /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs_hdfs/conf

total 148

-rw-r--r-- 1 solr solr 3974 2016-07-13 08:05 currency.xml

-rw-r--r-- 1 solr solr 1348 2016-07-13 08:05 elevate.xml

drwxr-xr-x 2 solr solr 4096 2016-07-13 08:05 lang

-rw-r--r-- 1 solr solr 55543 2016-07-13 08:05 managed-schema

-rw-r--r-- 1 solr solr 308 2016-07-13 08:05 params.json

-rw-r--r-- 1 solr solr 873 2016-07-13 08:05 protwords.txt

-rw-r--r-- 1 solr solr 62754 2016-07-13 08:08 solrconfig.xml

-rw-r--r-- 1 solr solr 781 2016-07-13 08:05 stopwords.txt

-rw-r--r-- 1 solr solr 1119 2016-07-13 08:05 synonyms.txt

Super Collaborator

@Saurabh Kumar - Since this example is using the Sandbox zookeeper rather than embedded zk, try adding /solr to the end of your zookeeper entry in the create command like this sandbox.hortonworks.com:2181/solr. I'm not sure if that will solve the issue but when Solr runs in cloud mode with an external zookeeper it makes /solr the zookeeper root to keep it's data separate from other services.

Guru

Thanks @james.jones, I would do that, but if I don't mentioned it then where exactly zookeeper will save solr configuration(solrconfig.xml).

Super Collaborator

This will upload your config directory to a configset named "testcoll". The default configset name is the same as your collection

./zkcli.sh -zkhost localhost:2181 -cmd upconfig -confdir ../../solr/configsets/data_driven_schema_configs/conf -confname testcoll.

If your configset is called testcoll, then do this to show the contents of the solrconfig.xml in zookeeper:

./zkcli.sh -zkhost localhost:2181 -cmd get /configs/testcoll/solrconfig.xml

I recommend running the list command which will dump everything in zookeeper, not just listing files but will print the contents of the files. That's a bit too much, so just pipe it to "less" and then search for your collection name as you would with vi (with / and ? to search). Then you'll see the path to your configs.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.