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.
[code language=”powershell”]
$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"
}
[/code]
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:
Happy Sitecoring and Happy Solring! 🙂
1 thought on “Install As Many Solr Instances As you Want on your Local Dev Machine for Sitecore 9”