- Make sure you have Java Runtime installed according to this: http://lucene.apache.org/solr/4_10_3/SYSTEM_REQUIREMENTS.html. Unless you know specifically otherwise choose the latest version of the 64-bit Java RTE from http://www.java.com.
- Download the Solr installation zip file from the Solr homepage:
Now that you have Java Runtime installed and you have downloaded the Solr zip file, it's time to move on to the next steps:
- Choose an installation folder (e.g. C:\Solr) and make sure you have write access. In this guide, the folder will be referred to as SOLR_MAIN_DIR. There is no installer so simply unzip the contents of the archive here (specifically the contents of the solr-4.10.3 folder within the archive). You should now have 6 folders within SOLR_MAIN_DIR (bin, contrib, dist, …) and some text files.
- Optional: Make sure Solr will start. Open the command prompt and navigate to SOLR_MAIN_DIR/example using the cd command. Then start the server using this command:
- Java –jar start.jar
- Check that Solr is accessible at:
http://localhost:8983/solr/ - Exit the command prompt with ctrl + C.
- Create a subfolder to SOLR_MAIN_DIR where your Solr configuration and Jetty will live (e.g. C:\Solr\SolrService). This folder will be referred to as SOLR_SERVICE_DIR. This folder is the one that needs to be shared and have its UNC path set in DAM config SOLR_UNC.
- Copy the contents of SOLR_MAIN_DIR\example\solr to SOLR_SERVICE_DIR – except the folder "collection1" which is an example core.
- Create a subfolder to SOLR_SERVICE_DIR called jetty.
- Copy the following folders and files into the jetty subfolder from SOLR_MAIN_DIR\example:
- contexts
- etc
- lib
- logs
- resources
- webapps
- start.jar
- Optional: Make sure Solr will start. Open the command prompt and navigate to SOLR_SERVICE_DIR\jetty using the cd command. Then start the server using this command:
- Java -Dsolr.solr.home=.. -jar start.jar
- Check that Solr is accessible at:
http://localhost:8983/solr/ - Exit the command prompt with ctrl + c.
- Download Apache Commons' Daemon package for Windows (make sure to get the Windows package that includes .exe files).
- When installing Solr on 64-bit Windows you need the prunserv.exe from the amd64 folder. Copy this file to SOLR_SERVICE_DIR\jetty and rename it to SolrService.exe – this is the actual Windows service executable.
- Copy prunmgr.exe into a new subfolder SOLR_SERVICE_DIR\jetty\serviceui and rename it also to SolrService.exe (to provide default service name) – this is the UI that allows to correct some of the parameters of the service after it had been setup via the command line.
- Make sure the computers environment variables have JAVA_HOME definer for system variables (not just user). Run sysdm.cpl as administrator and go to advanced tab. The variable value should look something like C:\Progra~1\Java\jresomeversion. Otherwise, attempting to start the service will produce the following message in the commons-daemon log: Unable to find Java Runtime environment.
- Run the service registration from SOLR_SERVICE_DIR\jetty as the administrator on the command prompt after replacing SOLR_SERVICE_DIR with the actual path and setting Xms and Xmx options to relevant values (or leaving them out). A rule of thumb is max ram reserved should be half the servers available RAM but this all depends on the server. The command should be all on a single line:
SolrService.exe //IS//SolrService --DisplayName="Solr Service" --Install=SOLR_SERVICE_DIR\jetty\SolrService.exe --LogPath=SOLR_SERVICE_DIR\jetty\logs --LogLevel=Debug --StdOutput=auto --StdError=auto --StartMode=java --StopMode=java --Jvm=auto ++JvmOptions=-Djetty.home=SOLR_SERVICE_DIR\jetty ++JvmOptions=-DSTOP.PORT=8087 ++JvmOptions=-DSTOP.KEY=stopsolr ++JvmOptions=-Djetty.logs=SOLR_SERVICE_DIR\jetty\logs ++JvmOptions=-Dorg.eclipse.jetty.util.log.SOURCE=true ++JvmOptions=-Xms768M ++JvmOptions=-Xmx8000M --Classpath=SOLR_SERVICE_DIR\jetty\start.jar --StartClass=org.eclipse.jetty.start.Main ++StartParams=OPTION=ALL ++StartParams=SOLR_SERVICE_DIR\jetty\etc\jetty.xml --StopClass=org.eclipse.jetty.start.Main ++StopParams=--stop ++JvmOptions=-Dsolr.solr.home=SOLR_SERVICE_DIR --StartPath=SOLR_SERVICE_DIR\jetty
Optional: save the command as "installSolrService.cmd" so it can be easily edited and reinstalled with changed parameters later.
Info: the service can be uninstalled from the same command prompt with the command "sc delete SolrService".
Run the service:
- Start it from the Services control panel or SolrService.exe start from command prompt.
- Check the log files in the log subfolder, specifically commons-daemon.<date>.log for messages.
- If there is an error message, run serviceui\SolrService.exe and try to correct possible problems. An account that runs the service may need to switch to one with full access to the folders (e.g. administrator).
- If the service stays in "starting" mode it is either misconfigured, JAVA_HOME is not set or you trying to run it with a 32-bit java. You have to kill the process manually.
- The success criteria here is being able to access Solr Web Admin UI from http://localhost:8983/solr
- In the Services control panel, change status of Solr Service from manual to automatic to ensures it runs after a restart. Try stopping and starting the service to test that it works.
1.1 Directory structure
The final folder structure should look like this:
- Solr (SOLR_MAIN_DIR)
- bin
- contrib
- dist
- docs
- example
- licenses
- SolrService (SOLR_SERVICE_DIR)
- bin
- jetty
- contexts
- etc
- lib
- logs
- resources
- serviceui
- solr-webapp
- webapps
- customer1_### (not at first but after a DAM has successfully enabled a Solr search)
- Other solr cores ..