I've the following configuration file within conf/Catalina/localhost
in Tomcat 7:
<Context docBase="webapps/solr.war" debug="0" crossContext="true" >
<Environment name="solr/home" type="java.lang.String" value="/opt/solr/home" override="true" />
<Environment name="data/dir" type="java.lang.String" value="/var/lib/solr" override="true" />
</Context>
where I would like to separate my solr.home
from data.dir
.
I've tested the above config files, but doesn't seems to work.
Is it something possible using that this kind of XML configuration file?
I've checked on GitHub and there are some configuration files which they have it there, but I couldn't make it working.
Posted by Chris Hostetter (Hoss) back in 2010 at solr-user group.
I don't think it's possible to use Tomcat context environment entries for data directory without patching Solr. It seems only
solr/home
variable works fine.The better way of doing is by using JVM system property file (
solrcore.properties
) which should be located either within your Solrconf/
home directory (or:collection1/conf
) or TomcatWEB-INF/
dir with the following entry:by using and reload your app or restart your Tomcat service to reload Java properties.
Alternatively is to use
solr.xml
(in Solr 4.x) by setting differentinstanceDir
anddataDir
which would separatedataDir
from the configuration files.