I want to transfer from the old solr.xml format to the main autodiscover in 4.4, but I had a problem with sharing the configuration (solrconfig.xml, schema.xml and dependent files) between the kernels, as I'm used to.
My old solr.xml file was something like this:
<?xml version="1.0" encoding="UTF-8" ?> <solr persistent="true"> <cores defaultCoreName="core1" adminPath="/admin/cores"> <core instanceDir="."name="core1" dataDir="core/core1"/> <core instanceDir="."name="core2" dataDir="core/core2"/> ... </cores> </solr>
Directory structure:
solr.xml conf schema.xml solrconfig.xml ... core core1 core2 ...
Everything worked perfectly in this way, the whole configuration was divided between the kernels. It worked because the dir instance of all the kernels where they were the same, and the conf directory were under it.
With kernel auto-detection in 4.4, it is not possible to have the same dir instance for all cores. Although, I found a solution that works:
Directory structure:
solr.xml common conf schema.xml solrconfig.xml ... core core1 core.properties data core2 core.properties data ...
solr.xml:
<solr> <str name="sharedLib">common</str> </solr>
core.properties:
name=core1
This works because the conf directory is in the classpath, thanks to the shareLib directive. But this is not entirely satisfactory because I cannot display the configuration files in 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 between all cores in version 4.4?
source share