Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Solr create collection error

avatar
Expert Contributor

Hello,

when I try to create collection on Solr, it fails with this message;

Error CREATEing SolrCore 'solrCollection_shard2_replica2': Unable to create core [solrCollection_shard2_replica2] Caused by: Element type \"directoryFactory\" must be followed by either attribute specifications, \">\" or \"/>\"."}}

I run this command;

solr create -c solrCollection -d data_driven_schema_configs -n solrConfigs -s 2 -rf 2

My config of /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs/conf/solrconfig.xml is;

<directoryFactory name="DirectoryFactory" class="solr.HdfsDirectoryFactory">
<str name="solr.hdfs.home">hdfs://myhdfshome:8020/user/solr</str>
<str name="solr.hdfs.confdir">/etc/hadoop/conf</str>
<bool name="solr.hdfs.blockcache.enabled">true</bool>
<int name="solr.hdfs.blockcache.slab.count">1</int>
<bool name="solr.hdfs.blockcache.direct.memory.allocation">true</bool>
<int name="solr.hdfs.blockcache.blocksperbank">16384</int>
<bool name="solr.hdfs.blockcache.read.enabled">true</bool>
<bool name="solr.hdfs.nrtcachingdirectory.enable">true</bool>
<int name="solr.hdfs.nrtcachingdirectory.maxmergesizemb">16</int>
<int name="solr.hdfs.nrtcachingdirectory.maxcachedmb">192</int>
</directoryFactory>
1 ACCEPTED SOLUTION

avatar
New Contributor

Hi Mayuk,

The error message is meaningless to me because it evokes that the config file should be changed and you should correct the xml. However, when I tried your command purely, I got the same error and decided to correct the command instead of config file.

1) As you get error message from solr I believe you are under correct "bin" directory.

# <SOLR_HOME>/bin/solr ...

2) A little bit confused here, the question is where do you keep your config files? Let's say you keep your config files under "<DirOfConfigurations>/data_driven_schema_configs/". (May be it is "/opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs/" for your setup)

# <SOLR_HOME>/bin/solr -c solrCollection -d /<DirOfConfigurations>/data_driven_schema_configs/ -n solrConfigs -s 2 -rf 2

I wish it would be helpful.

View solution in original post

6 REPLIES 6

avatar
New Contributor

Hi Mayuk,

The error message is meaningless to me because it evokes that the config file should be changed and you should correct the xml. However, when I tried your command purely, I got the same error and decided to correct the command instead of config file.

1) As you get error message from solr I believe you are under correct "bin" directory.

# <SOLR_HOME>/bin/solr ...

2) A little bit confused here, the question is where do you keep your config files? Let's say you keep your config files under "<DirOfConfigurations>/data_driven_schema_configs/". (May be it is "/opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs/" for your setup)

# <SOLR_HOME>/bin/solr -c solrCollection -d /<DirOfConfigurations>/data_driven_schema_configs/ -n solrConfigs -s 2 -rf 2

I wish it would be helpful.

avatar
Expert Contributor

Thank you.

avatar
Guru

@ilker danyal kanatlı I am also getting following error, Can you please help me .

[solr@m1 solr]$ bin/solr create -c SolrCollection -d /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs -n mySolrConfigs -s 2 -rf 2

Connecting to ZooKeeper at m1.hdp22:2181,m2.hdp22:2181,w1.hdp22:2181

Re-using existing configuration directory mySolrConfigs

Creating new collection 'SolrCollection' using command:

http://192.168.56.41:8983/solr/admin/collections?action=CREATE&name=SolrCollection&numShards=2&repli...

{

"responseHeader":{

"status":0,

"QTime":1365},

"failure":{"":"org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at http://192.168.56.41:8983/solr: Error CREATEing SolrCore 'SolrCollection_shard1_replica2': Unable to create core [SolrCollection_shard1_replica2] Caused by: Open quote is expected for attribute \"{1}\" associated with an element type \"name\"."}}

avatar
Expert Contributor
@Saurabh Kumar

Looks from the error that the configuration file -"solrconfig.xml" is not properly configured for schema -"data_driven_schema_configs".

Try to see if the "solrconfig.xml" is properly configured. If you need help, then, please upload the "solrconfig.xml" which you are presently using.

avatar
Guru
@Ravi

I have uploaded my solrconfig.xml.

avatar
New Contributor

@Saurabh Kumar

Sorry for late reply, i was in a vacation. I agree what Ravi says. If solrconfig.xml(I have not dig into it yet.) has properly configured then you may look following...

Copy all lines of the solrconfig.xml to an empty notepad and replace all " with ” or vice versa.