- 1 year ago
Solr Cloud as windows service
To run Solr Cloud as a Windows service, you can use the NSSM (Non-Sucking Service Manager) tool. NSSM allows you to create and manage Windows services for any executable.
Here's how you can set up Solr Cloud as a Windows service using NSSM:
Download NSSM:
Download NSSM from the official website: https://nssm.cc/download. Choose the appropriate version (32-bit or 64-bit) based on your system.Install Solr:
First, make sure you have Solr installed on your machine. You can download the Solr distribution from the Apache Solr website: https://lucene.apache.org/solr/downloads.htmlCreate a Solr Cloud Directory:
Create a directory for your Solr Cloud instance. For example,C:\solr_cloud
.Create a Solr Cloud Configuration:
Create your Solr Cloud configuration in theC:\solr_cloud
directory, including the necessarysolr.xml
and collection configurations.Create a Batch File:
Create a batch file (e.g.,start_solr.bat
) to start Solr using NSSM:batch@echo off
setlocal
set SOLR_HOME=C:\solr_cloud
set SOLR_PORT=8983
nssm install SolrCloud %SOLR_HOME%\bin\solr.cmd start -p %SOLR_PORT%
nssm set SolrCloud Description "Solr Cloud Windows Service"
nssm set SolrCloud AppParameters "-cloud -p %SOLR_PORT%"
nssm start SolrCloud
endlocal
Run the Batch File:
Run thestart_solr.bat
batch file from the command prompt. This will install and start the Solr Cloud service.Access Solr Web UI:
Open a web browser and access the Solr Web UI by navigating tohttp://localhost:8983
.Stop the Service:
To stop the service, run the following command:shnssm stop SolrCloud
This setup will allow you to run Solr Cloud as a Windows service using NSSM. You can manage the Solr service using the standard Windows service management tools or NSSM commands. Keep in mind that you'll need to adjust the paths and configuration parameters in the batch file according to your specific setup.