NSSM – Solr – Zookeeper – Fusion
Fusion Production Farm on Windows Servers
All parts run as Windows Services to avoid stoppages when users log out
Written by Anria Billavara – Innovent Solutions Inc. 8 Dec 2015
Requirements and Constraints
This is a case of a 3 Virtual Servers farm, in a very Microsoft dependent environment.
Every piece of software must run as a self sufficient Windows Service, which can start itself automatically upon server restart.
Software
| Use | Software |
|---|---|
| Operating System | Windows Server R2 |
| Solr | 5.2.1 |
| Zookeeper | 3.5.1 |
| Lucidworks Fusion | 2.1.1 |
| Java | jdk-7u79-windows-x64 |
| Windows Services | Download here |
| Important | NSSM does NOT work with JDK 8 |
| Windows Services Fusion | Download here |
Install Windows Services script
Next to the nssm.exe executable, create this installWindowsServices.bat file.
NOTE: Obviously change the paths to the paths you installed on.
@echo off echo ------------------------------------------ echo - Install Windows Service : ApacheZookeeper echo ------------------------------------------ nssm.exe install ApacheZookeeper Application D:\apache\zookeeper351\bin\run.bat nssm.exe set ApacheZookeeper Application D:\apache\zookeeper351\bin\run.bat nssm.exe set ApacheZookeeper AppDirectory D:\apache\zookeeper351\bin nssm.exe set ApacheZookeeper DisplayName Apache Zookeeper nssm.exe set ApacheZookeeper Description Apache Zookeeper 3.5.1 nssm.exe set ApacheZookeeper Start SERVICE_AUTO_START nssm.exe set ApacheZookeeper AppRestartDelay 0 echo ------------------------------------------ echo - Install Windows Service : ApacheSolr echo ------------------------------------------ nssm.exe install ApacheSolr Application D:\apache\solr521\bin\run.bat nssm.exe set ApacheSolr Application D:\apache\solr521\bin\run.bat nssm.exe set ApacheSolr AppDirectory D:\apache\solr521\bin nssm.exe set ApacheSolr DisplayName Apache Solr nssm.exe set ApacheSolr Description Apache Solr 5.2.1 nssm.exe set ApacheSolr Start SERVICE_AUTO_START nssm.exe set ApacheSolr DependOnService ApacheZookeeper nssm.exe set ApacheSolr AppRestartDelay 15 echo ------------------------------------------ echo - Install Windows Service : ApacheSolr echo ------------------------------------------ prunsrv //IS//LWFusionService --DisplayName="Lucidworks Fusion" --Description="Lucidworks Fusion Control Script" --StartMode=exe --StartPath="d:\Lucidworks\fusion211\bin" --StartImage="d:\Lucidworks\fusion211\bin\fusion.cmd" --StartParams="start" --StopMode=exe --StopPath="d:\Lucidworks\fusion211\bin" --StopImage="d:\Lucidworks\fusion211\bin\fusion.cmd" --StopParams="stop" --StopTimeout=60 --Startup="auto" --LogPath="d:\Lucidworks\log\windowsservice\fusion" echo Done
in CMD prompt, execute installWindowsServices.bat
ERRORS in the Windows Service? – Remove them
Create a removeServices.bat file.
nssm.exe remove ApacheSolr nssm.exe remove ApacheZookeeper prunsrv //DS//LWFusionService
