How to share the architecture and configuration between the cores between SOLR 4.4?

I want to migrate from the old solr.xml format to the core automatic discovery in 4.4, but I encountered sharing configuration (solrconfig.xml, schema.xml and related files between cores) ).

My old solr.xml is like this:






...

Directory structure:

solr.xml
conf
schema.xml< br /> solrconfig.xml
...
core
core1
core2
...

Everything works perfectly this way , The entire configuration is shared between the cores. It is working because the instance directory of all cores is the same, and the conf directory is under it.

Using the core auto-discovery in 4.4, it is impossible to use it for all cores The same instance directory. Although, I found an effective solution:

Directory structure:

solr.xml
common
conf
schema.xml
solrconfig.xml
...
core
core1
core.properties
data
core2
core.prop erties
data
...

solr.xml:


common

core.properties:

name=core1

It works because the conf directory is in the classpath, thanks to the shareLib directive. But it is not completely satisfactory because I cannot display the configuration file in the admin webapp, I get the following exception:

java.lang.NullPointerException
at org.apache.solr.handler.admin.ShowFileRequestHandler.showFromFileSystem(ShowFileRequestHandler.java:210)
at org.apache.solr .handler.admin.ShowFileRequestHandler.handleRequestBody(ShowFileRequestHandler.java:122)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.core .SolrCore.execute(SolrCore.java:1904)

Is there a better way to share configuration among all cores in 4.4?

We encountered the same problem. We tried to specify a relative path in the core.properties folder, But this didn’t work.

What we ended up doing was creating a conf folder in the SOLRHome folder, and then creating a symbolic link in the core/conf directory.

Here is the command I executed to create a symbolic link:

ln -s ../../conf/solrconfig.xml solrconfig.xml
ln -s ../../conf/schema.xml schema.xml

I want to migrate from the old solr.xml format to the core automatic discovery in 4.4, but I encountered Here comes the issue of sharing configuration (solrconfig.xml, schema.xml and related files) between cores.

My old solr.xml looks like this:

< /p>






...

Directory structure:

< pre>solr.xml
conf
schema.xml
solrconfig.xml

core
core1
core2

Everything works perfectly in this way, the entire configuration is shared between the cores. It is working because the instance directories of all cores are the same, and the conf directory is in Below it.

Using the core auto-discovery in 4.4, it is impossible to use the same instance directory for all cores. Although, I found an effective solution:

Directory structure:

solr.xml
common
conf
schema.xml
solrconfig.xml
...
core
core1
core.properties
data
core2
core.properties
data
...

solr.xml:


common

core.properties:

name=core1

It works because the conf directory is in the classpath, thanks to shareLib Instruction. But it is not completely satisfactory, because I cannot display the configuration file in the admin webapp, I get the following exception:

java.lang.NullPointerException
at org.apache.solr.handler.admin.ShowFileRequestHandler.showFromFileSystem(ShowFileRequestHandler.java:210)
at org.apache.solr.handler.admin.ShowFileRequestHandler.handleRequestBody(ShowFileRequestHandler.java:122)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.cor e.SolrCore.execute(SolrCore.java:1904)

Is there a better way to share configuration among all cores in 4.4?

We ran into the same problem. We tried to specify a relative path in the core.properties folder, but this did not work.

What we ended up doing was creating a conf folder in the SOLRHome folder, and then creating a symbolic link in the core/conf directory.

The following is the command I executed to create the symbolic link:

ln -s ../../conf/solrconfig.xml solrconfig.xml
ln -s ../../conf/schema.xml schema .xml

Leave a Comment

Your email address will not be published.