Skip to main content

When Solr is displaying results on the site, first step is to log in the server and check its status

● solr.service - LSB: Controls Apache Solr as a Service
     Loaded: loaded (/etc/init.d/solr; generated)
     Active: failed (Result: exit-code) since Wed 2024-04-17 23:22:52 UTC; 6h ago
       Docs: man:systemd-sysv-generator(8)

Apr 17 23:22:50 {name} systemd[1]: Starting LSB: Controls Apache Solr as a Service...
Apr 17 23:22:51 {name} su[750]: (to solr) root on none
Apr 17 23:22:51 {name} su[750]: pam_unix(su-l:session): session opened for user solr>
Apr 17 23:22:51 {name} su[750]: pam_unix(su-l:session): session closed for user solr
Apr 17 23:22:52 {name} systemd[1]: solr.service: Control process exited, code=exited>
Apr 17 23:22:52 {name} systemd[1]: solr.service: Failed with result 'exit-code'.
Apr 17 23:22:52 {name} systemd[1]: Failed to start LSB: Controls Apache Solr as a Se>

You might need to navigate to the directory where your Solr instance is installed, although this is not strictly necessary for restarting the service unless you have specific scripts in that directory. The default installation directory is usually /opt/solr or /var/solr, but this depends on how Solr was installed.

 

Stop Solr

You can stop Solr by running the following command

sudo service solr stop

Alternatively, if Solr was installed from a package, you might be able to use

sudo systemctl stop solr

 

Start Solr

After stopping, you can restart Solr by running:

sudo service solr start

Or, if you used systemctl to stop it:

sudo systemctl start solr

 

Check Status

To ensure Solr is running, you can check the status with:

sudo service solr status

Or:

sudo systemctl status solr

Response when completing a status check and it fails

× solr.service - LSB: Controls Apache Solr as a Service
     Loaded: loaded (/etc/init.d/solr; generated)
     Active: failed (Result: exit-code) since Tue 2024-06-04 08:52:21 UTC; 28min ago
       Docs: man:systemd-sysv-generator(8)
        CPU: 13ms

Jun 04 08:52:19 {name} systemd[1]: Starting LSB: Controls Apache Solr as a Service...
Jun 04 08:52:19 {name} su[615]: (to solr) root on none
Jun 04 08:52:19 {name} su[615]: pam_unix(su-l:session): session opened for user solr(uid=114) by (uid=0)
Jun 04 08:52:21 {name} solr[749]: Port 8983 is already being used by another process (pid: 837)
Jun 04 08:52:21 {name} solr[749]: Please choose a different port using the -p option.
Jun 04 08:52:21 {name} systemd[1]: solr.service: Control process exited, code=exited, status=1/FAILURE
Jun 04 08:52:21 {name} systemd[1]: solr.service: Failed with result 'exit-code'.
Jun 04 08:52:21 {name} systemd[1]: Failed to start LSB: Controls Apache Solr as a Service.

 

Restart Solr

sudo systemctl restart nginx

 

As the site has no results, there is no need to the Solr service.  Instead go with start Solr.

 

Response post starting / restarting Solr

● solr.service - LSB: Controls Apache Solr as a Service
     Loaded: loaded (/etc/init.d/solr; generated)
     Active: active (exited) since Thu 2024-04-18 06:09:03 UTC; 5s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 77653 ExecStart=/etc/init.d/solr start (code=exited, status=0/SUCCESS)

Apr 18 06:08:58 {name} systemd[1]: Starting LSB: Controls Apache Solr as a Service...
Apr 18 06:08:58 {name} su[77655]: (to solr) root on none
Apr 18 06:08:58 {name} su[77655]: pam_unix(su-l:session): session opened for user so>
Apr 18 06:09:03 {name} systemd[1]: Started LSB: Controls Apache Solr as a Service.

 

Related articles

Andrew Fletcher28 Aug 2024
Troubleshooting PHP 8.3 mbstring issues on Ubuntu with Nginx
Maintaining a Drupal site is usually smooth sailing once the environment is properly set up. However, even in a stable environment, updates to modules can sometimes reveal underlying configuration issues that weren't apparent before. This was the case when I updated a contrib module on a Drupal 10.3...
Andrew Fletcher09 Jun 2024
Overcoming startup challenges with Apache Solr on Ubuntu 24.04
Recently, after upgrading to Ubuntu 24.04, we encountered a significant challenge with our Apache Solr service—it refused to restart. This post documents the steps I took to diagnose and resolve the issues, providing a clear guide for anyone facing similar troubles. Initial troubleshootingThe...