3 Reasons why...

your SOLR Service is not starting

I recently had the problem that my SOLR Service was not starting all of a sudden. So I searched the internet and asked colleages but I had quite a hard time figuring out what the issue was. So here is a summary of possible reasons that you can check.

I usually install SOLR through a script created by Jeremy Davis (you can find it here).

I had several SOLR Versions installed already all starting using a different port to differentiate them. 

But all of a sudden, they were not started automatically anymore with start of the computer. Also a manual start through the Services App was not possible. But manual start in command prompt (in bin folder) using solr.cmd start started it with port 8983 and using solr.cmd start -p 8750 started it with Port 8750.

Here you find the 3 most common reasons:

Scroll down for details :-)

 

Testing your Service:

In Windows 10 hit Windows key or Start button and type "Windows Services".

NSSM 3

Start the Services App.

NSSM 4

Search for your service and see if status is Running. 

Running = OK

Paused = not OK

nothing = not OK

 

Hit Start the service

If it starts, don't read further ;-) If it doesn't hope you find a solution in this blogpost.

 

Reason 1: JAVA_HOME is set wrong

As I had updated my Java Version, that was actually the reason for me.

You can check two things here:

1.1. Go to your Windows Explorer and check the path to your Java installation

Check the path you have installed Java. In my case it is C:\Program Files\Java\jre1.8.0_221

System Variables 3

1.2. Check your System Variable JAVA_HOME

a) in Windows 10 hit start/ windows button and type/search "System Variables"

System Variables 1

 

b) In System Properties dialog on Advanced Tab hit "Environment Variables" Button

System Variables s

c) Check your JAVA_HOME Variable. Is the path correctly pointing to your Java JRE folder? If not Edit. 

System Variables 4

 

Reason 2: Wrong nssm Version

While browsing for reasons why my SOLR Service is not starting one reason pointed out in some pages was that the nssm version is not correct. It was pointed out that the featured pre-release nssm 2.24-101-g897c7ad should be used (check here).

 

2.1 Check nssm service

As the Script by Jeremy Davis creates SOLR service using nssm I checked if service be started using correct port.

a) Open Command Prompt 

b) navigate to C:\nssm\nssm-2.24\win64

c) type nssm.exe edit [SERVICE_NAME] e.g. nssm.exe edit solr-7.5.0

d) Check if arguments, path and startup directory (in Application Tab) are set correctly. Arguments should show: to -f -p 8750 (or what ever port you want to use) 

 NSSM 2

 

2.2 Create a new SOLR Service 

a) So I downloaded this version.

b) placed it under C:\nssm\

NSSM1

c) Open command prompt as Administrator

d) navigate to your newly added nssm e.g.: C:\nssm\nssm-2.24-101-g897c7ad\win64

d) type nssm.exe install [Service_Name] e.g.: nssm.exe install solr75-1

e) fill in Path e.g.: C:\solr\solr-7.5.0\bin\solr.cmd

f) Startup Directory is created automatically

g) fill in Argutments: -f -p [Your PORT] e.g.: -f -p 8750

NSSM 2

h) Your Service should now appear in Service App. Try to Start it.

 

Reason 3: Certificate issue

 Check your certificates and create new ones. You can find a good article I used here. No need to rewrite it: https://www.thewindowsclub.com/manage-trusted-root-certificates-windows

 To open Console Root type mmc to your run box.

 

Other reasons:

Delete a Windows Service

Just in case your tryed and errored like I did you should cleanup the windows services that you created and don't need anymore.

a) Open Command Prompt as Admin

b) Type sc delete [Service_Name] e.g.: sc delete solr75test2

Delete Windows Service

 

Note: if you do not have permission to delete the service you probably did not open cmd prompt as admin.

Created: 17.10.2019

SOLR