Showing posts with label SOLR. Show all posts
Showing posts with label SOLR. Show all posts

Tuesday, May 13, 2014

SOLR: Adding a new core

1. Create the required directories. Let's assume that the data directory is under /solr.
    /solr/new_core1/conf
    /solr/new_core1/data

2. Copy the conf directory from the existing core
    /solr/collection1/conf/* /solr/new_core1/conf

3. Create a solr.xml file in /solr/new_core1/conf directory, write below code in it:

<!--solr persistent="true" sharedLib="lib"-->
  <!--cores adminPath="/admin/cores"-->
    <!--core name="new_core1" instanceDir="/solr/new_core1"-->
      <!--property name="dataDir" value="/solr/new_core1/data" /-->
    <!--/core-->
<!--/solr-->


(remove comment before using the code)

4. Since the dataDir property is already defined in the solr.xml file, we need to comment out the dataDir element in /conf/solrconfig.xml. Search and replace with below line:

${solr.data.dir:./solr/core1/data}

5. Restart SOLR services (solrJetty).
Browse the solr to view the core:
http://localhost/solr/#/~cores/new_core1

Unable to create core: new_core Caused by: Can't find resource

Error :
Error CREATEing SolrCore 'new_core': Unable to create core: new_core Caused by: Can't find resource 'solrconfig.xml' in classpath or '\Bitnami\solr-4.8.0-0\apache-solr\solr\new_core\conf'

Locate log file and check for the error,
Log file location "installation_directory\solr-4.8.0-0\apache-solr\logs\solrjetty-stdout*"
new_core: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load core configuration for core new_core

Problem:
instanceDir and dataDir not exists on physical drive.

Solution:

instanceDir and dataDir need to exist before you can create the core.


Related Post:
Solr Add Core
web stats