Mark E. Haase
2015-03-26 16:24:02 UTC
I can't get the Core Admin API to work. I have a brand new installation of
Solr 5.0.0 (in non-cloud mode). I installed using the installation script
(a nice addition!) with default options, so I have Solr in /opt/solr and
its data in /var/solr.
Here's what I'm trying:
curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core
'
But I get this error:
Error CREATEing SolrCore 'new_core': Unable to create core [new_core]
Caused by: Can't find resource 'solrconfig.xml' in classpath or
'/var/solr/data/new_core/conf'
Solr isn't even creating /var/solr/data/new_core, which I guess is the root
of the problem. But /var/solr is owned by the solr user and I can do `sudo
-u solr mkdir /var/solr/data/new_core` just fine. So why isn't Solr making
this directory?
I see that 'instanceDir' is required, but I don't get an error message if I
*don't* use it, so I'm not sure how required it actually is. I'm also not
sure if its supposed to be a full path or a relative path or what, so here
are a couple of other guesses at the correct incantation:
curl '
http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core&instanceDir=new_core
'
curl '
http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core&instanceDir=/var/solr/data/new_core
'
These both return the same error message as my first try, so no dice...
FWIW, I get the same error message even if I try doing this with the Solr
Admin GUI so I'm really puzzled. Is the GUI supposed to work?
I found a thread on Stack Overflow about this same problem (
http://stackoverflow.com/a/28945428/122763) that suggests using configSet.
Okay, the installer put some configs sets in
/opt/solr/server /opt/solr/server/solr/configsets, and the 'basic_config'
config set has a solrconfig.xml in it, so maybe that would solve my
solrconfig.xml error?
If I compare the HTTP API to the `solr create -c foo` script, it appears
that the script creates the instance directory and copies in conf files *before
*it calls the HTTP API... surely the HTTP API doesn't require the caller to
create a directory and copy files first, does it?
Solr 5.0.0 (in non-cloud mode). I installed using the installation script
(a nice addition!) with default options, so I have Solr in /opt/solr and
its data in /var/solr.
Here's what I'm trying:
curl 'http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core
'
But I get this error:
Error CREATEing SolrCore 'new_core': Unable to create core [new_core]
Caused by: Can't find resource 'solrconfig.xml' in classpath or
'/var/solr/data/new_core/conf'
Solr isn't even creating /var/solr/data/new_core, which I guess is the root
of the problem. But /var/solr is owned by the solr user and I can do `sudo
-u solr mkdir /var/solr/data/new_core` just fine. So why isn't Solr making
this directory?
I see that 'instanceDir' is required, but I don't get an error message if I
*don't* use it, so I'm not sure how required it actually is. I'm also not
sure if its supposed to be a full path or a relative path or what, so here
are a couple of other guesses at the correct incantation:
curl '
http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core&instanceDir=new_core
'
curl '
http://localhost:8983/solr/admin/cores?action=CREATE&name=new_core&instanceDir=/var/solr/data/new_core
'
These both return the same error message as my first try, so no dice...
FWIW, I get the same error message even if I try doing this with the Solr
Admin GUI so I'm really puzzled. Is the GUI supposed to work?
I found a thread on Stack Overflow about this same problem (
http://stackoverflow.com/a/28945428/122763) that suggests using configSet.
Okay, the installer put some configs sets in
/opt/solr/server /opt/solr/server/solr/configsets, and the 'basic_config'
config set has a solrconfig.xml in it, so maybe that would solve my
solrconfig.xml error?
If I compare the HTTP API to the `solr create -c foo` script, it appears
that the script creates the instance directory and copies in conf files *before
*it calls the HTTP API... surely the HTTP API doesn't require the caller to
create a directory and copy files first, does it?
--
Mark E. Haase
Mark E. Haase