Created 05-18-2016 08:57 AM
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>
Created 05-23-2016 07:29 AM
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.
Created 05-23-2016 07:29 AM
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.
Created 05-23-2016 07:56 AM
Thank you.
Created 07-15-2016 12:33 PM
@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:
{
"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\"."}}
Created 07-17-2016 08:01 PM
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.
Created 07-19-2016 10:56 AM
I have uploaded my solrconfig.xml.
Created 07-27-2016 01:17 PM
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.