KNort
KNort

Reputation: 21

How to run Solr 5.0 as a background process in Windows?

How would one run the "bin/solr.cmd start" script so that it runs in the background in windows? Formerly, you could either run on tomcat and effectively run as a windows service. Alternatively, you could run the start.jar directly with "nohup" to prevent the hangup when the command prompt is closed.

With the release of Solr 5.0, it appears that Solr is now a standalone Java application that must be started with the start script (not a direct jar file).

Currently, if the command prompt that initiated the start command on Windows is closed, the application stops.

Upvotes: 2

Views: 1419

Answers (2)

user2523216
user2523216

Reputation: 173

I had the same problem upgrading from solr4

Solr 5 runs as a background service as default. Adding the -f parameter would run it in the foreground (which is needed if you run it as a windows service).

I'm using nssm (https://www.nssm.cc/download) to install Solr 5 as a windows service:

C:\nssm\nssm64.exe install "Solr 5.3.1" C:\search\solr-5.3.1\bin\solr.cmd "start -f -p 8983"

Upvotes: 0

Joe
Joe

Reputation: 389

You can use Apache common deamon library or sc.exe (Windows Library) to "install" something as a service, which it sounds like you want.

Upvotes: 0

Related Questions