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 Albert Ramstedt <al...@gmail.com> on 2008/04/17 22:58:51 UTC

Tomcat JNDI and CWD Configuration problem with multiple solrs

Hello List!

I am not an expert at configuring Tomcat, so I must be doing something
wrong, but for the life of me, I cannot find anything that would explain
this:

I want to have two separate solr apps running on one tomcat. I use the exact
configuration suggested here:

http://wiki.apache.org/solr/SolrTomcat#head-024d7e11209030f1dbcac9974e55106abae837ac

- Under multiple solr webapps.

The apps seem to work fine, only for some reason, when I start tomcat it
creates a solr dir in the cwd. So naturally, depending on where i do the
restart, it wont work. If i cd to some dir where I have write access, the
apps goes up fine, and it even says the solr/home is where it should be.
(The dir i defined in the xml file, NOT cwd). But under statistics, both
separate solr apps seems to use an IndexReader under CWD. Ideally I would
want to be able to configure this, so I know where the reader keeps its
files. And must both apps share this directory? I suspect this sharing is
why I cannot reindex both apps at the same time, since it touches some .lock
file during reindexing in the reader dir.

I use the exact same xml files under /Catalina/localhost/solr1.xml etc as
the wiki says. Same behaviour in tomcat 5.5 that ships with Ubuntu 7.10 and
my own install of tomcat 6. (Although I dont understand why the example has
"f:/" stuff in the directory paths, since that notation throws errors at me.

Does anyone know if I am doing something wrong, and how I can have separate
IndexReader folders?

Albert

Re: Tomcat JNDI and CWD Configuration problem with multiple solrs

Posted by Albert Ramstedt <al...@gmail.com>.
OMG!

I found the error. I cant believe how much time i spent on this and it turns
out i should pay more attention. (Or really, I can believe, because it
happens more frequently than I wish it would).

Anyway, for those having the same issue in the future:

I am using acts_as_solr, a rails plugin for solr searching. And to set up
solr for my railsapp I blindly copied the solrconfig.xml from the plugin to
my solr/conf dir and installed the jndi context into tomcat and expected it
to work. What I experienced was that it then proceeded to create a
solr/index dir under cwd. This because the solrconfig.xml in acts_as_solr
has this line in the config:

 <dataDir>${solr.data.dir:./solr/data}</dataDir>

It seems this creates the datadir under cwd. And it is probably not wanted
when you install it on a systemwide tomcat app server. Problem solved when i
commented that line out.

Hopefully this will save future acts_as_solr users some pain.

Albert

On Sat, Apr 19, 2008 at 12:05 AM, Chris Hostetter <ho...@fucit.org>
wrote:

>
> : The apps seem to work fine, only for some reason, when I start tomcat it
> : creates a solr dir in the cwd. So naturally, depending on where i do the
>
> Solr does not ever attempt to create a directory named "solr" (the only
> directories Solr tries to create if they don't already exist are inside
> of hte data dir)
>
> : restart, it wont work. If i cd to some dir where I have write access,
> the
> : apps goes up fine, and it even says the solr/home is where it should be.
>
> so what get's put in this solr dir that is created for you?  my guess is
> it's the expanded war file -- there is probably a tomcat setting for where
> these should go, and your tomcat configs have it as "."
>
> : (The dir i defined in the xml file, NOT cwd). But under statistics, both
> : separate solr apps seems to use an IndexReader under CWD. Ideally I
> would
>
> can you be more explicit about what exactly you are seeing (ie: cut+paste
> the log messages from Solr startup about solr home nad JNDI, cut+paste
> exactly what you see on the statistics page, etc..., cut+paste the shell
> commands you are running -- starting with a call to pwd so we know what
> the current directory is, cut+paste the directory listings of each
> directory you ae refering to.)
>
> : my own install of tomcat 6. (Although I dont understand why the example
> has
> : "f:/" stuff in the directory paths, since that notation throws errors at
> me.
>
> That's just an example of a windows path.
>
>
> -Hoss
>
>

Re: Tomcat JNDI and CWD Configuration problem with multiple solrs

Posted by Chris Hostetter <ho...@fucit.org>.
: The apps seem to work fine, only for some reason, when I start tomcat it
: creates a solr dir in the cwd. So naturally, depending on where i do the

Solr does not ever attempt to create a directory named "solr" (the only 
directories Solr tries to create if they don't already exist are inside 
of hte data dir)

: restart, it wont work. If i cd to some dir where I have write access, the
: apps goes up fine, and it even says the solr/home is where it should be.

so what get's put in this solr dir that is created for you?  my guess is 
it's the expanded war file -- there is probably a tomcat setting for where 
these should go, and your tomcat configs have it as "."

: (The dir i defined in the xml file, NOT cwd). But under statistics, both
: separate solr apps seems to use an IndexReader under CWD. Ideally I would

can you be more explicit about what exactly you are seeing (ie: cut+paste 
the log messages from Solr startup about solr home nad JNDI, cut+paste 
exactly what you see on the statistics page, etc..., cut+paste the shell 
commands you are running -- starting with a call to pwd so we know what 
the current directory is, cut+paste the directory listings of each 
directory you ae refering to.)

: my own install of tomcat 6. (Although I dont understand why the example has
: "f:/" stuff in the directory paths, since that notation throws errors at me.

That's just an example of a windows path.


-Hoss