Tuesday, October 31, 2017

Sitecore 9 SOLR installation and running as a service

When installing Sitecore 9, having SOLR running as a windows service is a required pre-requisite. For those developers like myself that stuck with Lucene for too long, here is how to get SOLR running locally.

  1. Download and install the Java Runtime Environment (JRE)
  2. Set a JAVA_HOME environment variable which points to the java install location
    1. Open up advanced system settings
    2. Click environment variables
    3. Add new
  3. Download SOLR (in this case 6.6.2)
  4. Place the extracted files in the location C:\SOLR
  5. Export a local certificate (in IIS) to a .PFX file, then place this file at the root of the C drive. In my case the file was called local.pfx
  6. Run the following command: "keytool -importkeystore -srckeystore C:\local.pfx -srcstoretype pkcs12 -destkeystore C:\solr\server\etc\solr-ssl.keystore.jks -deststoretype JKS" - this will prompt for the password entered when exporting the certificate. It needs to be run from the Java bin folder (in my case "C:\Program Files\Java\jre-9.0.1\bin").
  7. Open the solr.in.cmd file (located in C:\solr\bin) and un-comment the SSL settings shown below. Ensure you set the password as entered during the key import.
  8. Download NSSM - which will allow us to start SOLR as a service
    1. Place the extracted folder in your program files folder
  9. In the CMD change directory to the NSSM exe (in my case C:\Program Files\nssm-2.24\win64)
  10. Run the command nssm install solr6.6.2
  11. Enter the following information:
  12. Click install service
  13. Now open up services and start the SOLR service
SOLR will now run automatically as a windows service as required by Sitecore 9.

This post is a slight expansion of Installing Sitecore 9 dev environment by Patrick Stysiak.

No comments:

Post a Comment