lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Krugler <kkrugler_li...@transpac.com>
Subject Re: Using Solr w/Resin
Date Tue, 18 Apr 2006 21:11:26 GMT
>On 4/18/06, Ken Krugler <kkrugler_lists@transpac.com> wrote:
>>  2. Cloned/edited the resin.conf file to include a mapping for 
>>Solr, by adding:
>>
>>         <web-app id='/solr/'>
>>          <document-directory>webapps/solr-nightly</document-directory>
>>         </web-app>
>
>I normally just copy the war to solr.war, so I don't need the mapping...
>
>>  3. Started up Resin.
>>
>>  It created the <resin root>/webapps/solr-nightly directory, as
>>  expected, but then when I tried to use the Solr servlet it complained
>>  about not finding solrconfig.xml (see stack trace at end of email).
>
>By default, Solr looks in the current-working-directory/solr/conf for
>solrconfig.xml and schema.xml,

 From the code, it appears to try:

  * $CWD/solrconf/
  * $CWD/
  * $CLASSPATH

Maybe my code is out of date, but I didn't see /solr/conf being used 
as the path.

>and creates the index under
>current-working-directory/solr/data

 From the code, I see it being created at $CWD/data, where "data" is 
the default if not specified in the solrconfig.xml.

>One way you can direct Solr to a different home location is setting
>the solr.solr.home property...
>./startup -Dsolr.solr.home=/foo/bar/solr

This didn't work for me. I tried a number of different permutations, 
but maybe I missed the magic combination. When I grepped the source, 
I didn't see this pattern (solr.solr.home) being used anywhere.

I was able to control the location of the config file by using 
-Dsolr.configDir=<resin root>/webapps/solr/conf/ to set the location.

But the /data directory still gets created in <resin root>. I saw in 
SolrServlet.java's init() method these lines:

     String configDir=getServletContext().getInitParameter("solr.configDir");
     String dataDir=getServletContext().getInitParameter("solr.dataDir");

Though the servlet doesn't seem to use either, and I didn't see 
solr.dataDir being used in the code anywhere, and trying to control 
it from the command line didn't seem to work.

I could uncomment & edit the <dataDir> tag in the solrconfig.xml 
file, and that worked.

All of the above makes me worried that I'm missing something, or have 
the wrong sources, but from what I can tell:

1. The only ways to control the location of the data directory (used 
for the index) are...

a. Change the CWD - not sure how to do that for a webapp inside of Resin.

b. Edit the <dataDir> tag in the solrconfig.xml file. This also lets 
you change the name of the directory.

2. The only ways to control the location of the config directory are...

a. Change the CWD.

b. Pass -Dsolr.configDir=xxx in the command line to Resin's httpd.sh 
script. This also lets you change the name of the directory.

Thanks,

-- Ken
-- 
Ken Krugler
Krugle, Inc.
+1 530-210-6378
"Find Code, Find Answers"

Mime
View raw message