Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr 5: Adding a new Core fails out of the box

Tags:

solr

So I'm just playing around with Solr 5, but I tried to add a new Core through the Admin UI and the command line with:

bin/solr create -c new_core

But in both situations I get the following error:

new_core: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core new_core: Error loading solr config from /Users/blah/lib/solr-5.3.0/server/solr/new_core/conf/solrconfig.xml

I started my Solr server using this:

bin/solr start

I'm following the docs here:

https://cwiki.apache.org/confluence/display/solr/Running+Solr

So what's the fix? How was this supposed to work out of the box given I assume there must be some template that the Admin UI uses when creating new cores?

like image 557
chubbsondubs Avatar asked Sep 01 '15 16:09

chubbsondubs


People also ask

Where are Solr cores stored?

Any core. properties file in any directory of your Solr installation (or in a directory under where solr_home is defined) will be found by Solr and the defined properties will be used for the core named in the file. In standalone mode, solr. xml must reside in solr_home .

How do I delete a core in Solr?

For the solr delete command the -c <name> option is required while the other options (parameters) are optional. Delete the named Solr core or collection with default options. Solr will delete the specified core and its associated configuration files at the first port number found.


1 Answers

The error is coming because there is no new_core configured in your setup. Please perform the following steps:

mkdir /Users/blah/lib/solr-5.3.0/server/solr/core_name
echo "name=core_name" > /Users/blah/lib/solr-5.3.0/server/solr/core_name/core.properties
cp -r /Users/blah/lib/solr-5.3.0/server/solr/configsets/basic_configs/conf /Users/blah/lib/solr-5.3.0/server/solr/core_name/

Some important point to note:

  1. core.properties and conf directory should be placed at same path.
  2. conf directory will contain the schema.xml and solrconfig.xml files.
like image 153
YoungHobbit Avatar answered Sep 17 '22 19:09

YoungHobbit