About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
administration:starting_and_stopping_solr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
administration:starting_and_stopping_solr [2023/03/10 11:50] demiankatzadministration:starting_and_stopping_solr [2023/03/10 11:57] – [Linux (systemd) Method] demiankatz
Line 158: Line 158:
 // Thanks to [[https://github.com/jriedl|jriedl]] for investigating this issue. // // Thanks to [[https://github.com/jriedl|jriedl]] for investigating this issue. //
  
-Most modern flavors of Linux (such as CentOS 7 and newer) use [[https://en.wikipedia.org/wiki/Systemd|systemd]] instead of the earlier init.d approach.+Most modern flavors of Linux (such as CentOS 7 and newer) use [[https://en.wikipedia.org/wiki/Systemd|systemd]] instead of the earlier [[administration:starting_and_stopping_solr:init.d]] approach. Instructions on the older approach have been moved to [[administration:starting_and_stopping_solr:a separate init.d page]].
  
 To automate Solr with systemd: To automate Solr with systemd:
Line 205: Line 205:
  
 Alternatively, you could investigate using the automation tools bundled with Solr 5+. Alternatively, you could investigate using the automation tools bundled with Solr 5+.
- 
-==== Linux (init.d) Method ==== 
- 
-:!: Most modern Linux distributions use systemd instead of init.d; please see the instructions below unless you are sure that init.d is a better approach for your situation. 
- 
-You can set up Solr to run as a daemon. To do so, create a wrapper script in /etc/init.d/vufind: 
- 
-:!: Important: These instructions were written for VuFind 3.0 or later, when the Solr script was changed to solr.sh instead of vufind.sh; if running VuFind 2.x or earlier, you should replace "solr.sh" with "vufind.sh" in these examples. 
- 
-:!: If you need to run VuFind with non-default settings, you may wish to add some lines to export environment variables in this script, or else source a script containing all of your environment settings prior to running "solr.sh". In many newer installations of VuFind, such a script is already set up as /etc/profile.d/vufind.sh. 
- 
-:!: Newer versions of Solr do not like to be run by the root user; you may need to either add "export SOLR_ADDITIONAL_START_OPTIONS=-force" to your script to force root permissions, or (preferably) set up your script to run Solr as a [[administration:security#creating_a_dedicated_solr_user|dedicated user]] (which can be done by wrapping the solr.sh command with "/bin/su - username -c ...").  
- 
-<code> 
-#!/bin/sh 
-### BEGIN INIT INFO 
-# Provides: vufind 
-# Required-Start: 
-# Required-Stop: 
-# Default-Start: 2 3 4 5 
-# Default-Stop: 0 1 6 
-# Description: VuFind init script 
-### END INIT INFO 
-cd /usr/local/vufind 
-./solr.sh $* 
-</code> 
- 
-// Note: The information in the INIT INFO block is only required for RedHat-style systems that use the chkconfig utility.  You may need to adjust the start and stop runlevels depending on your system configuration. // 
- 
-// Note: If your VuFind instance is installed somewhere other than /usr/local/vufind, be sure to adjust the cd line in the script accordingly. // 
- 
-Make sure that the script is executable (sudo may be needed on the command for some platforms): 
- 
-<code> 
-chmod +x /etc/init.d/vufind 
-</code> 
- 
-You will then need to add the script to your runlevel configuration (generally found under /etc/rc.d).  The exact setup varies from flavor to flavor of Linux, but a bit of online research should help, as should these tools: 
- 
-  On RedHat (including Fedora): chkconfig --add vufind 
-  On Debian (including Ubuntu): update-rc.d vufind defaults        
- 
-If this doesn't seem to work, be sure that VUFIND_HOME and JAVA_HOME are set in the profile of the user running the startup script. 
- 
-=== Interacting with Solr After Automation === 
- 
-On some platforms, the "service" command is available to make use of startup scripts.  In this case, you will be able to use it for Solr after completing configuration: 
- 
-<code> 
-service vufind start 
-service vufind stop 
-service vufind restart 
-service vufind check 
-</code> 
- 
-//("sudo" may need to be prefixed to these commands depending on your Linux flavor and security configuration)// 
- 
-If service is available, it is the preferred way of starting and stopping Solr after automation. 
  
 ==== Windows Method ==== ==== Windows Method ====
administration/starting_and_stopping_solr.txt · Last modified: 2023/10/24 13:47 by demiankatz