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 galo <ga...@last.fm> on 2007/02/26 19:46:20 UTC
Multiple instances, wiki out of date?
Hi there,
I've been following the instruction from
http://wiki.apache.org/solr/SolrJetty?highlight=%28Multiple%29%7C%28Solr%29%7C%28Webapps%29solr
to get a few indexes running under the same instance of jetty 6.1.2. If
I use the webapp descriptors as specified in the wiki (with correct
paths, I'm just pasting the example here)..
<Call name="addWebApplication">
<Arg>/*solr*1/*</Arg>
<Arg>/your/path/to/the/*solr*.war</Arg>
<Set name="extractWAR">true</Set>
<Set
name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set>
<Call name="addEnvEntry">
<Arg>*solr*/home</Arg>
<Arg type="String">/your/path/to/your/*solr*/home/dir</Arg>
</Call>
</Call>
<Call name="addWebApplication">
<Arg>/*solr*2/*</Arg>
<Arg>/your/path/to/the/*solr*.war</Arg>
<Set name="extractWAR">true</Set>
<Set
name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set>
<Call name="addEnvEntry">
<Arg>*solr*/home</Arg>
<Arg type="String">/your/path/to/your/alternate/*solr*/home/dir</Arg>
</Call>
</Call>
Jetty complains that:
2007-02-26 18:36:04.874::INFO: Logging to STDERR via
org.mortbay.log.StdErrLog
2007-02-26 18:36:05.066::WARN: Config error at <Call
name="addWebApplication"><Arg>/solr1/*</Arg><Arg>/your/path/to/the/solr.war</Arg><Set
name="extractWAR">true</Set><Set
name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set><Call
name="addEnvEntry"><Arg>solr/home</Arg><Arg
type="String">/your/path/to/your/solr/home/dir</Arg></Call></Call>
2007-02-26 18:36:05.066::WARN: EXCEPTION
java.lang.IllegalStateException: No Method: <Call
name="addWebApplication"><Arg>/solr1/*</Arg><Arg>/your/path/to/the/solr.war</Arg><Set
name="extractWAR">true</Set><Set
name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set><Call
name="addEnvEntry"><Arg>solr/home</Arg><Arg
type="String">/your/path/to/your/solr/home/dir</Arg></Call></Call> on
class org.mortbay.jetty.Server
at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:548)
at
org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:241)
at
org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:203)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:919)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mortbay.start.Main.invokeMain(Main.java:183)
at org.mortbay.start.Main.start(Main.java:497)
at org.mortbay.start.Main.main(Main.java:115)
2007-02-26 18:36:05.068::INFO: Shutdown hook executing
2007-02-26 18:36:05.068::INFO: Shutdown hook complete
I've been looking at the Jetty API and it looks like those methods are
deprecated in the latest versions of Jetty. Anyway, I can get several
instances to run together using the descriptor shown below and several
war files
<Call name="addLifeCycle">
<Arg>
<New class="org.mortbay.jetty.deployer.WebAppDeployer">
<Set name="contexts"><Ref id="Contexts"/></Set>
<Set name="webAppDir"><SystemProperty name="jetty.home"
default="."/>/webapps-plus</Set>
<Set name="parentLoaderPriority">false</Set>
<Set name="extract">true</Set>
<Set name="allowDuplicates">false</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home"
default="."/>/etc/webdefault.xml</Set>
</New>
</Arg>
</Call>
This is good enough for me but the problem then is that all point to the
same data/index folder sharing the same index and I need them to use
different indexes. The question is, how can you configure solr.home
differently for each of the solr instances deployed in the webapps-plus
folder?
It would be equally valid if there is a way of fixing the xml in the
wiki so individual war files can be specified passing a different
solr.home to each..
thanks,
galo.
Re: Multiple instances, wiki out of date?
Posted by Chris Hostetter <ho...@fucit.org>.
Galo: are you using plain vanilla Jetty, or are you using Jetty Plus?
the examples for "Configuring Solr Home with JNDI" and "Multiple Solr
Webapps" both require Jetty Plus (because the JNDI support only exists in
the extra libraries JettyPlus provides)
That may explain the missing method call when trying to do addEnvEntry
if you can't use Jetty Plus to have JNDI support, or if the latest version
of Jetty doesn't support JNDI anymore (can't imagine that would be the
case) then you might be able to find a way to set teh solr.solr.home
system property on a per webapp basis ... how to do that in a Jetty config
may be a better question for the Jetty user community.
(if you do discover that the config syntax for JNDI has changed
significantly in the latest versions of Jetty, by all means please update
the wiki ... we'd probably want seperate sections for the different
versions since not everyone will be running the latest, but it's still
good info to have)
-Hoss