开发者

How do you deploy Solr and front-end web app configuration within a servlet container

开发者 https://www.devze.com 2023-03-04 16:36 出处:网络
I admit that this is newbie question, but I\'ve searched for hours trying to figure this out. How exactly do you deploy BOTH Solr and your front-end Java web app (jsp/html/velocity/whatever) within a

I admit that this is newbie question, but I've searched for hours trying to figure this out. How exactly do you deploy BOTH Solr and your front-end Java web app (jsp/html/velocity/whatever) within a servlet container?

The sample application that comes with Solr uses velocity templates but I'd like to create my own stand alone web app that uses Solr behind the scenes (as well as a DB).

Do you start up Solr on its own first, in a separate servlet container (e.g. java -jar start.jar with the included Jetty container) and then start your second java servlet conta开发者_高级运维iner with your web app in another Java servlet container?

Or do you start both Solr and your front end web app in the same servlet container but using different contexts?

I want to access my front end web app with just a "/" context and then behind the scenes access Solr with the "/solr" context.

What's the best practice for this, if I want to use SolrJ to access Solr from my Java web app? Ideally, I'd like to start them in the same container, as for now this is a small web app.

I'd like to use either Tomcat or Jetty as my servlet container(s). I'm just confused if I should run both the solr.war and my web app war in one container or do I have to split them up in two separate containers.

Many thanks for your help.


You can run both your apps just fine in one container. Take the solr.war and deploy it as-is according to your containers instructions. For Tomcat you can just place it in $TOMCAT_HOME/webapps and it will get expanded. Install your app using whatever other means, hot deploy, WAR, etc.

Should be fairly straight-forward. I've done this in the past and the above is pretty much the recipe

0

精彩评论

暂无评论...
验证码 换一张
取 消