Install As Many Solr Instances As you Want on your Local Dev Machine for Sitecore 9

Dear Sitecore Enthusiasts,

Recently, we all have started installing multiple Solr instances for trying out different Sitecore 9 instances – to check out their new features and trying them first hand and one of the common problems that we as Sitecore Devs face is about setting up different Solr instances on our local machine with SSL.

Challenge:

How do I install Solr instances for Multiple Sitecore 9 instances on my machine?

Solution:

I must thank Jeremy Davis for the Amazing Powershell Script that he has contributed to the Sitecore Community! Did you his post on the same — don’t worry, check it here – Low Effort Solr Installs.

So I took the very same script and added another parameter $solrInstanceName which I am using while checking if the Service is installed and if not, then install it.


$svc = Get-Service "$solrInstanceName" -ErrorAction SilentlyContinue
if(!($svc))
{
Write-Host "Installing Solr service"
&"$installFolder\nssm-$nssmVersion\win64\nssm.exe" install "$solrInstanceName" "$solrRoot\bin\solr.cmd" "-f" "-p $solrPort"
$svc = Get-Service "$solrInstanceName" -ErrorAction SilentlyContinue
}
if($svc.Status -ne "Running")
{
Write-Host "Starting Solr service"
Start-Service "$solrInstanceName"
}

 

The Complete PowerShell Script is at the following location: https://gist.github.com/varunvns/d7fb5201b05e84d972ba6ac6b9a45105

So, if you like the Script, credit goes to Jeremy Davis for giving us the Script!

Keep Creating As Many Solr instances as you require on your Local Dev Machine!

References:

  1. LOW-EFFORT SOLR INSTALLS
  2. Quickly add SSL to Solr

Happy Sitecoring and Happy Solring! 🙂

Advertisements

One thought on “Install As Many Solr Instances As you Want on your Local Dev Machine for Sitecore 9

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s