lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "SolrJetty" by Ramzi Alqrainy
Date Mon, 27 Jun 2011 07:54:19 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "SolrJetty" page has been changed by Ramzi Alqrainy:
http://wiki.apache.org/solr/SolrJetty?action=diff&rev1=22&rev2=23

  <<TableOfContents>>
  
  == Init script to run the Solr example ==
- 
  This section describes how to to make the Solr example run automatically as a service on
startup.  It assumes that the Solr distribution is unpacked, and has been tested by running
''java -jar start.jar'' from the example directory.
  
  Download the [[http://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk/jetty-distribution/src/main/resources/bin/jetty.sh|jetty.sh
startup script]], and place it at /etc/init.d/jetty.   On RedHat systems, uncomment the chkconfig
lines and use chkconfig to add it to the boot sequence.
@@ -22, +21 @@

  JETTY_USER=solr
  JETTY_LOGS=/opt/solr/logs
  }}}
- 
- All of these settings are important.  In particular, not setting JETTY_LOGS would lead jetty
to attempt (and fail) to place request logs in ''/home/solr/logs''. 
+ All of these settings are important.  In particular, not setting JETTY_LOGS would lead jetty
to attempt (and fail) to place request logs in ''/home/solr/logs''.
  
  The start-up script expects jetty to redirect standard input and output to a log file. 
Therefore, create ''/opt/solr/etc/jetty-logging.xml'' with the following:
  
@@ -56, +54 @@

  
  </Configure>
  }}}
- 
- 
  == Logging ==
- 
- For information about controlling JDK Logging (aka: java.util logging) in Jetty please consult
the Jetty docs... 
+ For information about controlling JDK Logging (aka: java.util logging) in Jetty please consult
the Jetty docs...  http://docs.codehaus.org/display/JETTY/Server+Log
- http://docs.codehaus.org/display/JETTY/Server+Log
  
  == Configuring Solr Home with JNDI ==
- 
  Jetty Plus provides an addEnvEntry for configuring the JNDI property needed to specify your
Solr Home directory.
  
  To do this, use an "addWebApplication" that looks something like this...
@@ -73, +66 @@

    <Call name="addWebApplication">
      <Arg>/solr/*</Arg>
      <Arg>/your/path/to/the/solr.war</Arg>
-     <Set name="extractWAR">true</Set> 
+     <Set name="extractWAR">true</Set>
      <Set name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set>
  
      <Call name="addEnvEntry">
@@ -82, +75 @@

      </Call>
    </Call>
  }}}
+ <<Anchor(MultiWebappJndi)>>
  
- <<Anchor(MultiWebappJndi)>>
  == Multiple Solr Webapps ==
  === Multiple Solr Webapps (pre-Jetty6) ===
- 
  Multiple solr instances can be run in a single Jetty Plus server by using multiple "addWebApplication"
Call blocks with different values for the `solr/home` JNDI parameter...
- 
  
  {{{
    <Call name="addWebApplication">
      <Arg>/solr1/*</Arg>
      <Arg>/your/path/to/the/solr.war</Arg>
-     <Set name="extractWAR">true</Set> 
+     <Set name="extractWAR">true</Set>
      <Set name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set>
  
      <Call name="addEnvEntry">
@@ -106, +97 @@

    <Call name="addWebApplication">
      <Arg>/solr2/*</Arg>
      <Arg>/your/path/to/the/solr.war</Arg>
-     <Set name="extractWAR">true</Set> 
+     <Set name="extractWAR">true</Set>
      <Set name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml</Set>
  
      <Call name="addEnvEntry">
@@ -115, +106 @@

      </Call>
    </Call>
  }}}
- 
  === Multiple Solr Webapps (Jetty6) ===
- 
- Jetty6 changed their context deployment syntax. Also, JNDI lookups, which are necessary
for deploying multiple Solr instances require a special configuration. The default Jetty6
install does not include JNDI support, but it is easily tacked on. See this page:
+ Jetty6 changed their context deployment syntax. Also, JNDI lookups, which are necessary
for deploying multiple Solr instances require a special configuration. The default Jetty6
install does not include JNDI support, but it is easily tacked on. See this page: [[http://docs.codehaus.org/display/JETTY/JNDI|JettyJNDI]]
- [[http://docs.codehaus.org/display/JETTY/JNDI|JettyJNDI]]
  
  New jetty.xml syntax:
- 
- 
  
  {{{
      <New  class="org.mortbay.jetty.webapp.WebAppContext">
@@ -138, +124 @@

          </New>
      </New>
  }}}
- 
  Where the variable for '''solr/home''' points to a directory containing a '''conf''' directory
that in turn has a '''solrconfig.xml''' file.
  
  == JNDI Caveats Noted By Users ==
- 
  (7/2007 MattKangas) The recipe above didn't work for me with Jetty 6.1.3. Specifying "solr/home"
via "`<New class="...EnvEntry">`" sets a GLOBAL value which gets evaluated after the
full configuration is read, so the last setting wins.
  
  Fortunately, I've found a solution that works well:
+ 
   * Specify "`ContextDeployer`" in `jetty.xml`
   * For each web app, add a `.xml` file in "`./contexts`"
-    * Set `ConfigurationClasses` to activate JNDI. (must be done separately for each webapp)
+   * Set `ConfigurationClasses` to activate JNDI. (must be done separately for each webapp)
-    * Set `overrideDescriptor` to define an [[http://docs.codehaus.org/display/JETTY/override+web.xml|override
web.xml file]]
+   * Set `overrideDescriptor` to define an [[http://docs.codehaus.org/display/JETTY/override+web.xml|override
web.xml file]]
-    * In the `overrideDescriptor` file, set an `<env-entry>` for "`solr/home`"
+   * In the `overrideDescriptor` file, set an `<env-entry>` for "`solr/home`"
  
- The "`overrideDescriptor`" settings will be applied AFTER it has been configured by the
default descriptor
+ The "`overrideDescriptor`" settings will be applied AFTER it has been configured by the
default descriptor and the WEB-INF/web.xml descriptor.
- and the WEB-INF/web.xml descriptor.
  
  Alas, you still need the additional "Plus" .jars, and you need to define the "`plusConfig`"
and set "`ConfigurationClasses`" appropriately. Without this, the `overrideDescriptor` won't
be applied.
  
@@ -162, +146 @@

  [[attachment:DEMO_multiple_webapps_jetty_6.1.3.tgz]]
  
  ----
- 
  (12/2008 KenEllinwood)  I'm using Solr-1.3.0 and Jetty 6.1.12.   Apparently the name for
JNDI must have a leading slash now., eg., "solr/home" becomes "/solr/home" in the jetty config
files.  I was able to get the example up and running in a stand-alone Jetty without fiddling
with the "overrideDescriptor" as described above.  I'm using !ContextDeployer in jetty.xml
with the following context definition.  Note the 3 argument syntax for the !EnvEntry -- this
appears to be a new requirement in more recent versions of Jetty.  Also, I had to use an absolute
path for the data directory in solrconfig.xml... not sure why.
  
  {{{
@@ -195, +178 @@

  
  </Configure>
  }}}
- 
  == Long HTTP GET Query URLs ==
- 
  If you're issuing very long HTTP GET queries to Solr, you may need to adjust the headerBufferSize
parameter for your connector in jetty.xml. (See http://docs.codehaus.org/display/JETTY/Configuring+Connectors)
The default for this parameter is 4K. If your buffer size is too small, the symptom client-side
won't be an error message but rather having your HTTP connection closed without an HTTP response.
  

Mime
View raw message