Abhay Pai
Abhay Pai

Reputation: 313

Relatively where does solr.data.dir in solrconfig.xml points to?

In all configuration below, a prefix of "solr." for class names is an alias that causes solr to search appropriate packages, including org.apache.solr.(search|update|request|core|analysis) You may also specify a fully qualified Java classname if you have your own custom plugins.

This is what I found while going through the solrconfig.xml file. But it seems this is defined to point to the respective classes in solr. I know somehow SOLR_HOME is used for solr.data.dir. I have used solr using "start.jar" and also using "solr-**-*.war" on Tomcat. It just works !!! :)

  1. So where does solr.data.dir points to ?
  2. Where exactly is SOLR_HOME is defined ?

Upvotes: 1

Views: 7414

Answers (3)

Andrei
Andrei

Reputation: 2332

If you are running on a MAC it's default installation directory (including data) - if installed via maven dependency at least - is in the /var/XXX directory.

cd /var
grep --color -iHrn solr .

Example on my machine for the index data location:

/var/folders/1j/z7f1373977s_qlfvv9t71kmh0000gq/T/solr-7.3.1/solr-7.3.1/server/solr/cores/catalog_reindex/data

Upvotes: 0

kenorb
kenorb

Reputation: 166477

So where does solr.data.dir points to?

The dataDir parameter is used to specify the directory for storing all index data. If this directory is not absolute, then it is relative to the directory where you started Solr. If the folder is empty, the new index would be re-created automatically when starting Solr.

Where exactly is SOLR_HOME is defined?

It really depends on operating system and web server used. And it defines the home directory of your Solr.

The most commonly it could be defined either:

  • in startup files,
  • using system environment variables, e.g.:

    export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/opt/solr/example"
    
  • during runtime as part of JAVA_OPTS (on Debian, in /etc/default/tomcat7 for instance, format: -Dmy.prop=value),
  • using System property substitution file (core.properties/solrcore.properties),
  • using Tomcat Context Configuration (e.g. in conf/Catalina/localhost by solr/home),
  • per Solr instance in solr.xml (instanceDir).

Upvotes: 3

Hussain
Hussain

Reputation: 112

Best is to specify it explicitly.

You can modify tomcat/bin/catalina.sh to add following JVM option:

-Dsolr.solr.home=/home/mdhussain/solr-test/deployment/solr1

Data directory is relative to solr home, you can override this in solrconfig.xml.

Upvotes: 1

Related Questions