2

As it will be apparent in some moments am more than a novice in jetty and tomcat. The job in hand is to run multiple applications in single jetty server and to change the url of SOLR home page something like localhost:8989/solr/node1 and localhost:8989/solr/node2. I have gone through the solutions at stackoverflow and also at http://wiki.apache.org/solr/SolrJetty but as I am handling jetty for the first time I am not aquaited with the jargons. I will be very obliged if somebody can give me a stepwise process,including what and where to change. Thanks a lot.

akhil
  • 23
  • 1
  • 3
  • do you only need multiple Solr instances, or are there other applications? – Mauricio Scheffer Jul 12 '11 at 13:40
  • Hi Maurico, I need multiple applications running in single jetty server. and as much as i know it will also need multiple SOLR instances too. the configuration can be on same port or on different ports. – akhil Jul 13 '11 at 04:10
  • ok, so this is more about Jetty than Solr then. – Mauricio Scheffer Jul 13 '11 at 04:13
  • Oh yes.. and sorry for being late in responding.was searching things allover again – akhil Jul 13 '11 at 04:55
  • It think, you are looking for multiple solr cores. You can run different "solr instances" in one J2EE container, which is in fact one solr instance with multiple cores. The configuration is easy. Look at this: [http://wiki.apache.org/solr/CoreAdmin](http://wiki.apache.org/solr/CoreAdmin) and [http://wiki.apache.org/solr/CoreAdmin#Configuration](http://wiki.apache.org/solr/CoreAdmin#Configuration) //Update: sorry, I notice the comment from Mauricio Scheffer to late. He had the same (correct) Idea - but one hour before! Sorry! – The Bndr Jul 12 '11 at 15:31
  • Hi Bndr,I am not looking for multiple cores,but I wish to run several applications on one instance of Jetty,either on single port or on multiple ports. kindly guide. – akhil Jul 13 '11 at 04:08
  • the different cores can handle different indexes for different applications. – The Bndr Jul 13 '11 at 07:43

2 Answers2

2

Check contexts directory under Jetty Home. You should add a new xml file for each application. Something like:

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
  <Set name="contextPath">solr/node2</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/node2.war</Set>
  <Set name="extractWAR">true</Set>
</Configure>

For more information check http://wiki.eclipse.org/Jetty/Howto/Deploy_Web_Applications , http://docs.codehaus.org/display/JETTY/ContextDeployer , http://www.enavigo.com/2008/08/29/deploying-a-web-application-to-jetty/

hkn
  • 1,453
  • 19
  • 21
0

If you want to run jetty in embedded way then you just need to place an xml file for each context at the place where your war/web application is present. In case you are not running jetty in embedded way then below link is useful. How can I map multiple contexts to the same war file in Jetty?

Community
  • 1
  • 1