Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Solr Jetty in background

I am using the Jetty/Solr build that comes with Solr and would like to run it in the background instead of in the terminal.

Right now I start it by java -jar start.jar but I would like it to log to a file and run in the background on the server so that I can close the terminal window.

I'm sure there is some java config that I can't find.

I have tried java -jar start.jar > log.txt & but no luck still outputs to the terminal window.

Thanks.

like image 257
user103219 Avatar asked Nov 26 '10 17:11

user103219


People also ask

Does Solr use Jetty?

Solr runs fine with Jetty, as illustrated by the solr/example application. See the instructions in the generic Solr installation page for basic setup info. Solr 1.4. 1 uses Jetty 6.1.

How do I run Solr in debug mode?

Right click on your Solr/Lucene Java project and select Debug As and then Debug Configurations . Under the Remote Java Application category. Click New to create a new debug configuration. Enter in the port we just specified to Java at the command line – 1044.


1 Answers

Try something like:

nohup yourcommand > output.log 2>&1 &

nohup will prevent yourcommand from being terminated in the event you log out.

& will run it in the background.

> output.log will send stdout to output.log

2>&1 will redirect stderr to stdout

like image 115
Joel Avatar answered Oct 13 '22 11:10

Joel