简体   繁体   中英

Running jetty+solr on Windows server

I am trying to create service for Windows.

I have .bat script that launches jetty with solr:

cd ../jetty
java -Djetty.home="C:/Webs/lrt-archyvas/jetty" -Djava.ext.dirs="C:/Webs/lrt-archyvas/parts/jetty-download/lib;C:/Webs/lrt-archyvas/parts/jetty-download/lib/jsp" -jar C:/Webs/lrt-archyvas/parts/jetty-download/start.jar C:/Webs/lrt-archyvas/jetty/etc/jetty.xml C:/Webs/lrt-archyvas/jetty/etc/jetty-deploy.xml C:/Webs/lrt-archyvas/jetty/etc/jetty-webapps.xml OPTIONS=Server,jmx,resources,websocket,ext,plus,annotations

I want to create service and in that case I want to use this http://drupal.org/node/1359598 tutorial.

Problem is that I can't use cd and go into jetty directory. I have to set it in parameters but I am unable to.

When I run this script from other directory I get the following:

2012-03-02 13:04:51.493:INFO::jetty-7.3.1.v20110307
2012-03-02 13:04:51.511:INFO::Deployment monitor C:\Webs\lrt-archyvas\bin\webapp
s at interval 1
2012-03-02 13:04:51.538:INFO::Started SelectChannelConnector@0.0.0.0:8080

It uses "C:\\Webs\\lrt-archyvas\\bin\\" (cwd) as jetty.home to load webapps. And I set it to C:/Webs/lrt-archyvas/jetty .

How can I override this?

You can set jetty.home on the java commandline with -Djetty.home="C:\\foo"

(you also ought to use windows paths for that to work I suspect, hence the backslashes)

the jetty start mechanism should pick this setting up and operate from there

I should add that since this is jetty 7 apparently being used there ought to be a start.ini file somewhere in there that you should be able to specify the options and xml files on. You can use the --dry-run option to have the actual option string that is being used.

If you experiment with --dry-run you should be able to iron out the precise string to drop into that service window for things to work. That ought to take some of the tedious process out of determining the correct string.

cheers

You can be easily run as a Windows service Solr can be used to exewrap.
Solr Windows Service all-in-one packages are also distributed.

http://exewrap.sourceforge.jp/solr/

I fear not being very helpful ... Could you give us more details ? What kind of software are you trying to use to set your application as a Windows service. Don't know if you can afford to use this product but it's a very good one : tutorial article download page

Have you edited the start.config Jetty file ? I guess it may be confused by a wrong location of the jar file (jetty home is computed like this in Jetty)....

HTH Jerome

You can try using procrun from Apache Commons Daemon project. Following post has lot of details.

Running Jetty 7 as Windows Service

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM