You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by jlist9 <jl...@gmail.com> on 2010/05/29 22:48:27 UTC
Solr on Tomcat, how to use an external data directory?
My solr index works fine with the embedded Jetty. I'm trying to move the
index to Tomcat. Following the wiki page http://wiki.apache.org/solr/SolrTomcat,
I put this line in setenv.bat:
set JAVA_OPTS=%JAVA_OPTS% "-Dfile.encoding=UTF-8"
"-Dsolr.solr.home=D:\opt\solr\example"
Tomcat seems to be picking it up. If I point it to a non-existent
directory or an empty
directory, Tomcat complains about it in console log.
However, the /solr/admin/stats.jsp page still shows that solr is using a default
directory, which is unsurprisingly located in tomcat bin dir:
readerDir : org.apache.lucene.store.SimpleFSDirectory@D:\Java\apache-tomcat-6.0.20\bin\solr\data\index
Any idea what else I need to do to use an external solr index
directory in Tomcat?
Thanks,
Jack
Re: Solr on Tomcat, how to use an external data directory?
Posted by jlist9 <jl...@gmail.com>.
I only have one solr instance so I followed the "Single Solr Instance",
which basically tells me to set -Dsolr.solr.home to the solr directory,
which I did ...
On Sat, May 29, 2010 at 2:32 PM, K Wong <wo...@gmail.com> wrote:
> There are directions on this page under Tomcat on Windows > Multiple Solr apps:
>
> http://wiki.apache.org/solr/SolrTomcat
>
> I'm running a multicore install on RHEL5/Tomcat5.5 and I just followed
> the docs and it went fine. I'm not sure that I can be of much help
> other than pointing you to the relevant docs, since I am not running
> this on Windows.
>
> K
>
>
>
> On Sat, May 29, 2010 at 1:48 PM, jlist9 <jl...@gmail.com> wrote:
>> My solr index works fine with the embedded Jetty. I'm trying to move the
>> index to Tomcat. Following the wiki page http://wiki.apache.org/solr/SolrTomcat,
>> I put this line in setenv.bat:
>>
>> set JAVA_OPTS=%JAVA_OPTS% "-Dfile.encoding=UTF-8"
>> "-Dsolr.solr.home=D:\opt\solr\example"
>>
>> Tomcat seems to be picking it up. If I point it to a non-existent
>> directory or an empty
>> directory, Tomcat complains about it in console log.
>>
>> However, the /solr/admin/stats.jsp page still shows that solr is using a default
>> directory, which is unsurprisingly located in tomcat bin dir:
>>
>> readerDir : org.apache.lucene.store.SimpleFSDirectory@D:\Java\apache-tomcat-6.0.20\bin\solr\data\index
>>
>> Any idea what else I need to do to use an external solr index
>> directory in Tomcat?
>>
>> Thanks,
>> Jack
>>
>
Re: Solr on Tomcat, how to use an external data directory?
Posted by K Wong <wo...@gmail.com>.
There are directions on this page under Tomcat on Windows > Multiple Solr apps:
http://wiki.apache.org/solr/SolrTomcat
I'm running a multicore install on RHEL5/Tomcat5.5 and I just followed
the docs and it went fine. I'm not sure that I can be of much help
other than pointing you to the relevant docs, since I am not running
this on Windows.
K
On Sat, May 29, 2010 at 1:48 PM, jlist9 <jl...@gmail.com> wrote:
> My solr index works fine with the embedded Jetty. I'm trying to move the
> index to Tomcat. Following the wiki page http://wiki.apache.org/solr/SolrTomcat,
> I put this line in setenv.bat:
>
> set JAVA_OPTS=%JAVA_OPTS% "-Dfile.encoding=UTF-8"
> "-Dsolr.solr.home=D:\opt\solr\example"
>
> Tomcat seems to be picking it up. If I point it to a non-existent
> directory or an empty
> directory, Tomcat complains about it in console log.
>
> However, the /solr/admin/stats.jsp page still shows that solr is using a default
> directory, which is unsurprisingly located in tomcat bin dir:
>
> readerDir : org.apache.lucene.store.SimpleFSDirectory@D:\Java\apache-tomcat-6.0.20\bin\solr\data\index
>
> Any idea what else I need to do to use an external solr index
> directory in Tomcat?
>
> Thanks,
> Jack
>
Re: Solr on Tomcat, how to use an external data directory?
Posted by jlist9 <jl...@gmail.com>.
The JVM arg seems to overwrite that just fine:
-Dsolr.data.dir=/opt/solr/example/data
On Sun, May 30, 2010 at 12:14 AM, Abdelhamid ABID <ae...@gmail.com> wrote:
> .. and to unset dataDir just leave it blank
> <dataDir>${solr.data.dir:}</dataDir>
>
> On Sun, May 30, 2010 at 12:15 AM, Chris Hostetter
> <ho...@fucit.org>wrote:
>
>>
>> : Most likely you have missed to point data directory in solrconf.xml,
>> : this should help :
>> : http://wiki.apache.org/solr/SolrConfigXml#dataDir_parameter
>>
>> right .. double check what the dataDir setting looks like ... if it's
>> unset it uses "data" in your solr instance directory, but if it is set,
>> it's (unfortunately) evaluated relative to the "current working directory"
>> of your servlet container and some versions of solr had "./data" listed in
>> the example solrconfig.xml
>>
>>
>>
>> -Hoss
>>
>>
>
>
> --
> Abdelhamid ABID
> Software Engineer- J2EE / WEB
>
Re: Solr on Tomcat, how to use an external data directory?
Posted by Abdelhamid ABID <ae...@gmail.com>.
.. and to unset dataDir just leave it blank
<dataDir>${solr.data.dir:}</dataDir>
On Sun, May 30, 2010 at 12:15 AM, Chris Hostetter
<ho...@fucit.org>wrote:
>
> : Most likely you have missed to point data directory in solrconf.xml,
> : this should help :
> : http://wiki.apache.org/solr/SolrConfigXml#dataDir_parameter
>
> right .. double check what the dataDir setting looks like ... if it's
> unset it uses "data" in your solr instance directory, but if it is set,
> it's (unfortunately) evaluated relative to the "current working directory"
> of your servlet container and some versions of solr had "./data" listed in
> the example solrconfig.xml
>
>
>
> -Hoss
>
>
--
Abdelhamid ABID
Software Engineer- J2EE / WEB
Re: Solr on Tomcat, how to use an external data directory?
Posted by jlist9 <jl...@gmail.com>.
You are right. Thanks Chris!
On Sat, May 29, 2010 at 4:15 PM, Chris Hostetter
<ho...@fucit.org> wrote:
>
> : Most likely you have missed to point data directory in solrconf.xml,
> : this should help :
> : http://wiki.apache.org/solr/SolrConfigXml#dataDir_parameter
>
> right .. double check what the dataDir setting looks like ... if it's
> unset it uses "data" in your solr instance directory, but if it is set,
> it's (unfortunately) evaluated relative to the "current working directory"
> of your servlet container and some versions of solr had "./data" listed in
> the example solrconfig.xml
>
>
>
> -Hoss
>
>
Re: Solr on Tomcat, how to use an external data directory?
Posted by Chris Hostetter <ho...@fucit.org>.
: Most likely you have missed to point data directory in solrconf.xml,
: this should help :
: http://wiki.apache.org/solr/SolrConfigXml#dataDir_parameter
right .. double check what the dataDir setting looks like ... if it's
unset it uses "data" in your solr instance directory, but if it is set,
it's (unfortunately) evaluated relative to the "current working directory"
of your servlet container and some versions of solr had "./data" listed in
the example solrconfig.xml
-Hoss
Re: Solr on Tomcat, how to use an external data directory?
Posted by jlist9 <jl...@gmail.com>.
Thanks! I tried that and it worked. It turned out that I also need to set
-Dsolr.data.dir=/opt/solr/example/data
On Sat, May 29, 2010 at 3:07 PM, Abdelhamid ABID <ae...@gmail.com> wrote:
> Most likely you have missed to point data directory in solrconf.xml,
> this should help :
> http://wiki.apache.org/solr/SolrConfigXml#dataDir_parameter
>
> On Sat, May 29, 2010 at 9:48 PM, jlist9 <jl...@gmail.com> wrote:
>
>> My solr index works fine with the embedded Jetty. I'm trying to move the
>> index to Tomcat. Following the wiki page
>> http://wiki.apache.org/solr/SolrTomcat,
>> I put this line in setenv.bat:
>>
>> set JAVA_OPTS=%JAVA_OPTS% "-Dfile.encoding=UTF-8"
>> "-Dsolr.solr.home=D:\opt\solr\example"
>>
>> Tomcat seems to be picking it up. If I point it to a non-existent
>> directory or an empty
>> directory, Tomcat complains about it in console log.
>>
>> However, the /solr/admin/stats.jsp page still shows that solr is using a
>> default
>> directory, which is unsurprisingly located in tomcat bin dir:
>>
>> readerDir : org.apache.lucene.store.SimpleFSDirectory@D
>> :\Java\apache-tomcat-6.0.20\bin\solr\data\index
>>
>> Any idea what else I need to do to use an external solr index
>> directory in Tomcat?
>>
>> Thanks,
>> Jack
>>
>
>
>
> --
> Abdelhamid ABID
> Software Engineer- J2EE / WEB
>
Re: Solr on Tomcat, how to use an external data directory?
Posted by Abdelhamid ABID <ae...@gmail.com>.
Most likely you have missed to point data directory in solrconf.xml,
this should help :
http://wiki.apache.org/solr/SolrConfigXml#dataDir_parameter
On Sat, May 29, 2010 at 9:48 PM, jlist9 <jl...@gmail.com> wrote:
> My solr index works fine with the embedded Jetty. I'm trying to move the
> index to Tomcat. Following the wiki page
> http://wiki.apache.org/solr/SolrTomcat,
> I put this line in setenv.bat:
>
> set JAVA_OPTS=%JAVA_OPTS% "-Dfile.encoding=UTF-8"
> "-Dsolr.solr.home=D:\opt\solr\example"
>
> Tomcat seems to be picking it up. If I point it to a non-existent
> directory or an empty
> directory, Tomcat complains about it in console log.
>
> However, the /solr/admin/stats.jsp page still shows that solr is using a
> default
> directory, which is unsurprisingly located in tomcat bin dir:
>
> readerDir : org.apache.lucene.store.SimpleFSDirectory@D
> :\Java\apache-tomcat-6.0.20\bin\solr\data\index
>
> Any idea what else I need to do to use an external solr index
> directory in Tomcat?
>
> Thanks,
> Jack
>
--
Abdelhamid ABID
Software Engineer- J2EE / WEB