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 Tod <li...@gmail.com> on 2011/10/13 18:06:16 UTC

Instructions for Multiple Server Webapps Configuring with JNDI

I'm following the instructions here:

http://wiki.apache.org/solr/SolrTomcat#Installing_Solr_instances_under_Tomcat

...under the heading "Multiple Solr Webapps".

I have configured the context fragment as instructed, placed the 
apache-solr-3.4.0.war in the directory pointed to by the docBase 
variable, and modified the solr/home accordingly.  I have an empty 
directory under tomcat/webapps named after the solr home directory in 
the context fragment.

The context fragment contains:

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/opt/solr/solr0/apache-solr-3.4.0.war" debug="0" 
crossContext="true">
   <Environment name="solr/home" type="java.lang.String" 
value="/opt/solr/solr0" override="true"/>
</Context>

An empty /tomcat/webapps/solr0 directory exists.

I expected to fire up tomcat and have it unpack the war file contents 
into the solr home directory specified in the context fragment, but its 
empty, as is the webapps directory.

What am I doing wrong?  I'm running Apache Tomcat/6.0.29.


TIA - Tod

Re: Instructions for Multiple Server Webapps Configuring with JNDI

Posted by Shawn Heisey <so...@elyograg.org>.
On 10/18/2011 6:59 AM, Tod wrote:
> One more question, is there a particular advantage of multiple solr 
> instances vs. multiple solr cores?

One way of doing multiple instances is running more than one copy of 
your container (tomcat/jetty/whatever).  I've never tried to put more 
than one .war file into a container ... I have no idea how to tell each 
one where its solr home is.  It may be possible, but I've never tried.  
Either way, you'd end up with overhead because a certain amount of 
memory is required just to get each copy of Solr started.  There is some 
additional flexibility with multiple containers - they can be easily 
stopped and started independently at the OS level.

With cores, there isn't as much overhead because there's only one 
application running, handling multiple indexes.  There is some ability 
to load/unload each index independently with CoreAdmin, but it's not 
controllable at the OS level.  In a well designed full system that 
includes software and hardware redundancy, being unable to independently 
stop/start an index isn't much of a worry.

Thanks,
Shawn


Re: Instructions for Multiple Server Webapps Configuring with JNDI

Posted by Tod <li...@gmail.com>.
On 10/14/2011 2:44 PM, Chris Hostetter wrote:
>
> : modified the solr/home accordingly.  I have an empty directory under
> : tomcat/webapps named after the solr home directory in the context fragment.
>
> if that empty directory has the same base name as your context fragment
> (ie: "tomcat/webapps/solr0" and "solr0.xml") that may give you problems
> ... the entire point of using context fragment files is to define webapps
> independently of a simple directory based hierarchy in tomcat/webapps ...
> if you have a directory there with the same name you create a conflict --
> which webapp should it use, the empty one, or the one specified by your
> contextt file?


Looks like that was the problem, once I removed the ./webapps/solr0 
directory and started tomcat back up it was recreated correctly.



> : I expected to fire up tomcat and have it unpack the war file contents into the
> : solr home directory specified in the context fragment, but its empty, as is
> : the webapps directory.
>
> that's not what the "solr/home" env variable is for at all.  tomcat will
> put the unpacked war where ever it needs/wants to (in theory it could just
> load it in memory) ... the point of the solr/home env variable is for you
> to tell the solr.war where to find the configuration files for this
> context.

Sorry, my mistake.  I wasn't referring to "solr/home" I was referring 
literally to the new solr home under tomcat - in this instance 
./webapps/solr0.

One more question, is there a particular advantage of multiple solr 
instances vs. multiple solr cores?


Thanks.

Re: Instructions for Multiple Server Webapps Configuring with JNDI

Posted by Chris Hostetter <ho...@fucit.org>.
: modified the solr/home accordingly.  I have an empty directory under
: tomcat/webapps named after the solr home directory in the context fragment.

if that empty directory has the same base name as your context fragment 
(ie: "tomcat/webapps/solr0" and "solr0.xml") that may give you problems 
... the entire point of using context fragment files is to define webapps 
independently of a simple directory based hierarchy in tomcat/webapps ... 
if you have a directory there with the same name you create a conflict -- 
which webapp should it use, the empty one, or the one specified by your 
contextt file?

: I expected to fire up tomcat and have it unpack the war file contents into the
: solr home directory specified in the context fragment, but its empty, as is
: the webapps directory.

that's not what the "solr/home" env variable is for at all.  tomcat will 
put the unpacked war where ever it needs/wants to (in theory it could just 
load it in memory) ... the point of the solr/home env variable is for you 
to tell the solr.war where to find the configuration files for this 
context.

Note in particular from the instructions you mentioned on the wiki...

"Copy the example/solr directory from the source to the installation 
directory like /opt/solr/example"


-Hoss