问题
How can I run solr on a windows server, so it starts up automatically?
I run it with:
java -jar start.jar
but I need the server to do this automatically.
回答1:
Create a batch file with the command you need and run it on startup: some of these ideas might be of use.
If you ran solr inside tomcat, you could start tomcat as a windows service and set the service to start automatically.
回答2:
I've had good luck with the "Non-Sucking Service Manager" to do this exact thing. Very simple and lightweight: http://nssm.cc/
回答3:
The Scheduled Tasks feature in Windows Server will let you configure your command to be executed at startup, without the use of a batch file.
回答4:
I will add the small solr windwos service installer that I found and updated recently :
https://github.com/serbrech/SolrWindowsService
First Update the App.config
<add key="JavaExecutable" value="C:\Program Files (x86)\Java\jre6\bin\java.exe" />
<add key="WorkingDirectory" value="C:\Solr\apache-solr-4.0\example" />
<add key="Solr.Home" value="solr" />
<add key="CommandLineArgs" value="-Djava.util.logging.config.file=logging.properties" />
<add key="ShowConsole" value="false" />
<add key="Port" value="8983" />
<add key="InstanceName" value="Pageplanner" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
Then run install.bat That's all there is to it.
来源:https://stackoverflow.com/questions/2531038/how-to-run-solr-on-a-windows-server-so-it-starts-up-automatically