solrwindows-server-2012-r2solr6

Run Solr 6.0.1 in background on Windows server


I'd like to start a solr core (version 6.0.1) on Windows Server 2012 R2(command is: bin\solr.cmd start), and keep it running after logging off. I'd also like to run it under an account other than my own, and I'd like it to start up automatically. I came across this post, How to run solr on a windows server so it starts up automatically?, but it was from 6 years ago, so I thought there may be a new way with the new version. Also, the new version I have is not running on Tomcat. It acts as it's own server, which is another difference from the version in the example. Thanks!


Solution

  • You can use NSSM to register Solr as a Windows Service.

    "c:\Program Files\nssm\win64\nssm" install solr6

    It's important that you use the -f parameter to run Solr in the foreground (which in this case means "run it inside NSSM"). This can be changed in the box that pops up for NSSM ("Arguments"). You can also pick which user to run the service as under "Log on".