Home

Awesome

SolrCloud Install Scripts

License: MIT

Want to automate setting up SolrCloud clusters on Windows? This repo has a load of scripting helpers which can do anything from making a test cluster on the current machine, to installing individual nodes for a production cluster. It's a toolkit for crafting your own installations, and a quick way to setup a test instance to play around with.

Deploying the scripts

Because this is toolkit of (hopefully) useful commandlets that can be used to automate parts of the install process, you need some sort of controlling script that defines your overall process. There are a couple of examples I've made myself below, but you may want to modify - but maybe you want to make your own from scratch.

Either way, you can grab the latest release zip, and extract it somewhere. That will get you both the example scripts and a module of commandlets.

The scripts work by importing the module from a child directory, so you can add two lines to your own script to install a module to help with .tar.gz files and then import the Solr commandlet module:

Install-Module "7Zip4Powershell"
Import-Module ".\SolrCloud-Helpers" -DisableNameChecking

You could install the commandlet module to your PowerShell modules directory if you preferred - but I found it simpler to work like this when deploying quickly onto target servers.

(And yes, I should probably sort out the naming so it doesn't need -DisableNameChecking but that's a job for another day)

Example scripts

For a quick-start the repo includes three example scripts:

Firstly, Setup-OpenJDK.ps1 can install OpenJDK for the JRE that Solr and Zookeeper depend on. It has one variable defined for configuring what happens:

Setup-SingleInstance.ps1 can be run to install a single-node SolrCloud instance on a machine. Setup-TripleInstance.ps1 will set up a three-node SolrCloud instance on a machine. In both cases there are six variables defined at the top of this script that you can use to configure it:

For example:

$targetFolder = "$([Environment]::GetFolderPath("Desktop"))\SolrCloud"
$installService = $false
$collectionPrefix = "search"
$solrPackage = "https://archive.apache.org/dist/lucene/solr/7.2.1/solr-7.2.1.zip" # For Sitecore v9.1

$zkData = @(
	@{Host = "localhost"; Folder="zk"; InstanceID=1; ClientPort = 2971; EnsemblePorts="2981:2991"}
)

$solrData = @(
	@{Host="solr"; Folder="SOLR"; ClientPort=9999}
)

All of the publicly exported script functions have help data. So help Configure-ZooKeeperForSsl (for example) will give you info about the behaviour and parameters.

Known issues