Hello everyone,

 

Bob Haschart just sent me the following email, suggesting a solution to the problem we discussed a few weeks ago where starting VuFind from a directory other than VUFIND_HOME causes empty Solr directories to get generated in inappropriate places and prevents VuFind from serving any results.

 

I have committed the suggested configuration changes to the trunk as r1957.

 

- Demian

 

From: Robert Haschart [mailto:rh9ec@virginia.edu]
Sent: Tuesday, December 15, 2009 5:12 PM
To: Demian Katz
Subject: Re: [VuFind-General] VuFind 1.0 RC2 Released

 

Demian,

One thing I discovered may be useful to you.   In the VuFind  multicore solrconfig.xml files  you have lines like this:

  <!-- Used to specify an alternate directory to hold all index data
       other than the default ./data under the Solr home.
       If replication is in use, this should match the replication configuration. -->
  <dataDir>${solr.data.dir:./solr/biblio}</dataDir>

and similarly for the authority and stats cores.

However as I am sure you've discovered, you have to be careful as to which directory you happen to be in when you start jetty to use the multicore configuration.   If you are in the wrong directory when you start jetty (or when you run SolrMarc), the server will create new data directories beneath that directory rather than using the correct solr directories.    And the "fix" that is often suggested for single core solr indexes of defining the system property  solr.data.dir  doesn't work, since that system property would then be used for all three of the solr cores created by VuFind.  

The second suggestion that is always made on the solr list of simply including the full path of the data directory in each of the solrconfig.xml file, is an even worse solution in my opinion.   Requiring full paths in config files is pretty much always a bad idea, especially for software that is designed to be distributed to many different sites.

Well I have come across a solution that works much better than any of these three methods:  Rather than referencing the system property  solr.data.dir  in the solrconfig.xml files,  you can reference the property solr.solr.home.   Which _has_ to be defined if you are using any location for solr other than the jetty default, (which is in a directory named solr, inside the jetty directory)

So in the solr/biblio/conf/solrconfig.xml file  define the dataDir as follows:

  <!-- Used to specify an alternate directory to hold all index data
       other than the default ./data under the Solr home.
       If replication is in use, this should match the replication configuration. -->
  <dataDir>${solr.solr.home:./solr}/biblio</dataDir>

and similarly for the authority and stats cores.

Then you will be able to start jetty (or SolrMarc) from any directory and not have extra authority or stats directories scattered all over the place.

-Bob Haschart