1

I am trying to get Tomcat 8 / Solr 4.10 running as a Windows service for my Sitecore installation. I am following the steps outlined here: http://www.ansoncheunghk.info/article/5-steps-install-multiple-apache-tomcat-instance-windows. I have the service installed and running fine. I changed some of the port values because this is actually a second instance of Tomcat on the box. When I try to open up the Solr UI at http://localhost:8984/solr I get the following error message:

HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: Could not load config file S:\solr410\solr410\example\solr\collection1\solrconfig.xml

When I set up the service these are the Java options I used:

-Dcatalina.home=S:\Tomcat
-Dcatalina.base=S:\Tomcat
-Djava.endorsed.dirs=S:\Tomcat\endorsed
-Djava.io.tmpdir=S:\Tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=S:\Tomcat\conf\logging.properties
-Dsolr.solr.home=S:\solr410\solr410\example\solr
-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv4Addresses=true

Also, I followed the instructions found here for setting up my Solr cores: https://sitecore-community.github.io/docs/search/solr/fast-track-solr-for-lazy-developers/

All of my cores are located at

S:\solr410\solr410\example\solr

. But for some reason it is complaining that it can't find the solrconfig.xml for the first core. I get the feeling that somehow I need to edit a config file or something so that it knows where to find the cores or the config files. I'm not completely sure.

2
  • Does Solr run OK if you launch it from a cmd line? Is your problem just getting it to run as a service?
    – G Killian
    Nov 11, 2016 at 21:57
  • Yes it runs fine from a command line. Just need to get it running as a service. Nov 11, 2016 at 21:58

2 Answers 2

3

You can download and install SOLR like a service using NSSM ( Non Sucking Service Manager) This example is using SOLR 5 but it wasn't a problem to install SOLR 4.10 like a service.

First, extract Solr 5 and NSSM to the following path on your file system.

1 C:\Program Files\solr-5.0.0 2. C:\Program Files\nssm

SETTING UP SOLR AS A SERVICE

On the command line, type the following:

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

Fill out the path to the solr.cmd script, and the startup directory should be filled in automatically. Don’t forget to input the -f (foreground) parameter so that NSSM can kill it when it needs to be stopped or restarted.

enter image description here

The following step is optional, but I prefer having a clean and descriptive name in my Windows Service Manager. Under the details tab, fill out the Display name and Description.

enter image description here

Details tab for NSSM service installer for setting up Solr 5 as a service on Microsoft Windows

Click on Install service.

enter image description here

Check that the service is running.

enter image description here

Microsoft Windows Component Services Running Solr 5

Go to your favorite web browser and make sure Solr 5 is up and running.

Solr 5 running as a service on Microsoft Windows

enter image description here

Source: https://www.norconex.com/how-to-run-solr5-as-a-service-on-windows/

0

This is my goto ref for running it as a service: ** Install Solr as a service on Windows: http://blog.outerthoughts.com/2013/07/setting-up-apache-solr-on-windows-as-a-service/ (note there are errors in their sample script, though!)

This is the exact cmd that I've used recently for some dev Solr 4.10 environments (SolrService is the renamed prunsrv.exe, so use what you like for it):

R:\solr-4.10.4\sitecore\SolrService.exe //IS//SolrService --DisplayName="Solr Service" --Install=R:\solr-4.10.4\sitecore\SolrService.exe --LogPath=R:\solr-4.10.4\sitecore\logs --LogLevel=Debug --StdOutput=auto --StdError=auto --StartMode=java --StopMode=java --Jvm=auto ++JvmOptions=-Djetty.home=R:\solr-4.10.4\sitecore ++JvmOptions=-DSTOP.PORT=8087 ++JvmOptions=-DSTOP.KEY=stopsolr ++JvmOptions=-Djetty.logs=R:\solr-4.10.4\sitecore\logs ++JvmOptions=-Dorg.eclipse.jetty.util.log.SOURCE=true ++JvmOptions=-XX:MaxPermSize=128M --Classpath=R:\solr-4.10.4\sitecore\start.jar --StartClass=org.eclipse.jetty.start.Main ++StartParams=OPTION=ALL ++StartParams=R:\solr-4.10.4\sitecore\etc\jetty.xml --StopClass=org.eclipse.jetty.start.Main ++StopParams=--stop ++JvmOptions=-Dsolr.solr.home=R:\solr-4.10.4\sitecore\solr --StartPath=R:\solr-4.10.4\sitecore

3
  • Hmmm. I am trying to use Tomcat. Would that make a difference here? I get confused and don't really understand what Tomcat and Jetty are. Are they similar things? Nov 11, 2016 at 22:06
  • Tomcat is a Java application server. It lacks some features common to full web servers so is often reverse proxied behind a web server like httpd or Jerry. BTW Jetty is a web server, which can also host Java apps (like Solr) Nov 11, 2016 at 23:38
  • To run SOLR you can use either. Both have all you need for this use case. Nov 11, 2016 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.