Creating Multiple Uniquely Named Solr Instances For Sitecore Development

solr-red Since the release of Sitecore 9.x and above Solr has been the default Search service and there is an requirement to install Solr with an SSL Certificate in order to use SIF to install Sitecore.
To simplify this I’ve been using this Powershell Script that Jeremy Davis kindly created for a while now.

In general it works brilliantly but if you want to keep all your Solr instances in C:\Solr as soon as I try to install a 2nd or 3rd instance of the same version of Solr (e.g a 2nd solr-6.6.2 instance for 9.02) I run into issues.
The script assumes that you don’t already have a folder called “\solr-6.6.2” in C:\Solr and fails. It will also fail on a number of other steps such as the cert name, service name and zip download/extraction.

Therefore I’ve modified the Script to support passing in a suffix which creates a unique instance of Solr using a $solrSuffix variable for various steps in the script.

Just set this variable to something that makes sense for that instance of Solr and run it e.g:

$solrSuffix = 902dev;

You should then have an unique instance of Solr and you can keep running the script again and again as long as the $solrSuffix is unique and you update the values of  $solrPort and $solrHost each time also.

unique-solr solr-installed

 

 

 

The script below is setup for Sitecore 9.1 installs (using Solr 7.2.1), but if you change the $solrVersion to 6.6.2 and set the other 3 variables mentioned above you can use it for Sitecore 9.0.x installs too.

This updated script has saved me quite a bit of time over the past few months, hopefully others will find this useful too.
Thanks again to Jeremy for writing the original script.

Published by

Adam Seabridge

I am a Freelance Sitecore Developer and 7x Sitecore Technology MVP (2024 - 2018). I have been working with Sitecore since 2013. You can reach me on twitter @billyjava or comment below if you have any questions or feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *