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.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
administration:starting_and_stopping_solr [2023/03/10 11:50] – demiankatz | administration:starting_and_stopping_solr [2023/10/24 13:47] (current) – Removed notes about releases prior to 3.0. demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Starting and Stopping Solr ====== | ====== Starting and Stopping Solr ====== | ||
- | Once VuFind | + | :!: This page applies to VuFind® versions 3.0 and newer; if you are using a very old release, see the "Old revisions" |
+ | |||
+ | Once VuFind® | ||
===== Starting Solr Manually ===== | ===== Starting Solr Manually ===== | ||
Line 7: | Line 9: | ||
==== Linux Method ==== | ==== Linux Method ==== | ||
- | To start Solr under Linux, just switch to the directory where you installed | + | To start Solr under Linux, just switch to the directory where you installed |
./solr.sh start | ./solr.sh start | ||
Line 14: | Line 16: | ||
chmod +x solr.sh | chmod +x solr.sh | ||
- | |||
- | :!: Prior to VuFind 3.0, solr.sh was named vufind.sh; be sure to use the command appropriate for your version. | ||
Note: If you previously rebooted your system without manually stopping Solr, the script may mistakenly believe that it is still running. | Note: If you previously rebooted your system without manually stopping Solr, the script may mistakenly believe that it is still running. | ||
Line 32: | Line 32: | ||
</ | </ | ||
- | This is warning of some default settings that could impact the performance of your Solr instance. On some Linux platforms, | + | This is warning of some default settings that could impact the performance of your Solr instance. |
+ | |||
+ | The best way to address the errors on Linux platforms using systemd is to start Solr through systemd and ensure that your [[# | ||
+ | |||
+ | On some Linux platforms, | ||
< | < | ||
Line 45: | Line 49: | ||
It may be necessary to log out of your terminal session and log back in for these settings to take effect. | It may be necessary to log out of your terminal session and log back in for these settings to take effect. | ||
- | On Linux platforms using systemd, you may be able to work around the problem with a systemd file like this example (in a file like / | ||
- | |||
- | < | ||
- | [Unit] | ||
- | Description=VuFind Starter | ||
- | After=network.target | ||
- | |||
- | [Service] | ||
- | Type=forking | ||
- | ExecStart=/ | ||
- | PIDFile=/ | ||
- | User=vufind-user | ||
- | ExecStop=/ | ||
- | SuccessExitStatus=0 | ||
- | LimitNOFILE=65000 | ||
- | LimitNPROC=65000 | ||
- | |||
- | [Install] | ||
- | WantedBy=multi-user.target | ||
- | </ | ||
- | |||
- | (Obviously the / | ||
- | |||
- | Once this is in place, you can use "sudo service vufind start" and "sudo service vufind stop" to start and stop the process, and appropriate limits will be applied. | ||
==== Windows Method ==== | ==== Windows Method ==== | ||
- | VuFind | + | VuFind® |
- | * At a command prompt, switch to your VuFind | + | * At a command prompt, switch to your VuFind® |
* Type: solr start | * Type: solr start | ||
- | Note that some of the scripting for this command is created automatically as part of the install.bat setup process. | + | Note that some of the scripting for this command is created automatically as part of the install.php setup process. |
- | + | ||
- | :!: Prior to VuFind 3.0, solr.bat was named vufind.bat; be sure to use the command appropriate for your version. Prior to VuFind 1.0RC2, Windows support was not included. | + | |
===== Stopping Solr Manually ===== | ===== Stopping Solr Manually ===== | ||
Line 84: | Line 62: | ||
==== Linux Method ==== | ==== Linux Method ==== | ||
- | To take the server offline, switch to the VuFind | + | To take the server offline, switch to the VuFind® |
./solr.sh stop | ./solr.sh stop | ||
- | |||
- | :!: Prior to VuFind 3.0, solr.sh was named vufind.sh; be sure to use the command appropriate for your version. | ||
==== Windows Method ==== | ==== Windows Method ==== | ||
- | When using VuFind 3.0 or newer, you can stop Solr from the command line in Windows: | + | You can stop Solr from the command line in Windows: |
- | * At a command prompt, switch to your VuFind | + | * At a command prompt, switch to your VuFind® |
* Type: solr stop | * Type: solr stop | ||
- | |||
- | In VuFind 2.x or earlier, to stop a manually-started Solr instance under Windows, open the command prompt window where the server is running and hit Ctrl-C. | ||
===== Restarting Solr Manually ===== | ===== Restarting Solr Manually ===== | ||
Line 103: | Line 77: | ||
==== Linux Method ==== | ==== Linux Method ==== | ||
- | Restarting Solr under Linux is much the same as starting it. Just switch to the VuFind | + | Restarting Solr under Linux is much the same as starting it. Just switch to the VuFind® |
./solr.sh restart | ./solr.sh restart | ||
- | |||
- | :!: Prior to VuFind 3.0, solr.sh was named vufind.sh; be sure to use the command appropriate for your version. | ||
==== Windows Method ==== | ==== Windows Method ==== | ||
- | When using VuFind 3.0 or newer, you can restart Solr from the command line in Windows: | + | You can restart Solr from the command line in Windows: |
- | * At a command prompt, switch to your VuFind | + | * At a command prompt, switch to your VuFind® |
* Type: solr restart | * Type: solr restart | ||
- | |||
- | In VuFind 2.x and earlier, there is no graceful way to restart a manually-started Solr instance under Windows. | ||
===== Killing an Unresponsive Solr Process ===== | ===== Killing an Unresponsive Solr Process ===== | ||
Line 158: | Line 128: | ||
// Thanks to [[https:// | // Thanks to [[https:// | ||
- | Most modern flavors of Linux (such as CentOS 7 and newer) use [[https:// | + | Most modern flavors of Linux (such as CentOS 7 and newer) use [[https:// |
To automate Solr with systemd: | To automate Solr with systemd: | ||
Line 179: | Line 149: | ||
ExecStop=/ | ExecStop=/ | ||
SuccessExitStatus=0 | SuccessExitStatus=0 | ||
+ | LimitNOFILE=65000 | ||
+ | LimitNPROC=65000 | ||
[Install] | [Install] | ||
Line 184: | Line 156: | ||
</ | </ | ||
- | The above example should work for VuFind | + | The above example should work for VuFind® |
Be sure to adjust paths in the code above to match your local system. | Be sure to adjust paths in the code above to match your local system. | ||
Line 205: | Line 177: | ||
Alternatively, | Alternatively, | ||
- | |||
- | ==== 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 / | ||
- | |||
- | :!: 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 " | ||
- | |||
- | :!: 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 " | ||
- | |||
- | :!: Newer versions of Solr do not like to be run by the root user; you may need to either add " | ||
- | |||
- | < | ||
- | #!/bin/sh | ||
- | ### BEGIN INIT INFO | ||
- | # Provides: vufind | ||
- | # Required-Start: | ||
- | # Required-Stop: | ||
- | # Default-Start: | ||
- | # Default-Stop: | ||
- | # Description: | ||
- | ### END INIT INFO | ||
- | cd / | ||
- | ./solr.sh $* | ||
- | </ | ||
- | |||
- | // Note: The information in the INIT INFO block is only required for RedHat-style systems that use the chkconfig utility. | ||
- | |||
- | // Note: If your VuFind instance is installed somewhere other than / | ||
- | |||
- | Make sure that the script is executable (sudo may be needed on the command for some platforms): | ||
- | |||
- | < | ||
- | chmod +x / | ||
- | </ | ||
- | |||
- | You will then need to add the script to your runlevel configuration (generally found under / | ||
- | |||
- | On RedHat (including Fedora): chkconfig --add vufind | ||
- | On Debian (including Ubuntu): update-rc.d vufind defaults | ||
- | |||
- | If this doesn' | ||
- | |||
- | === Interacting with Solr After Automation === | ||
- | |||
- | On some platforms, the " | ||
- | |||
- | < | ||
- | service vufind start | ||
- | service vufind stop | ||
- | service vufind restart | ||
- | service vufind check | ||
- | </ | ||
- | |||
- | // | ||
- | |||
- | If service is available, it is the preferred way of starting and stopping Solr after automation. | ||
==== Windows Method ==== | ==== Windows Method ==== | ||
- | As of VuFind 3.0, Solr can be started as a background process from the command line, so it should be possible manage it from within Windows; however, detailed instructions and best practices have not been developed as of this writing. Please feel free to contribute your own recommendations! | + | Solr can be started as a background process from the command line, so it should be possible manage it from within Windows; however, detailed instructions and best practices have not been developed as of this writing. Please feel free to contribute your own recommendations! |
===== Taking the User Interface Offline ===== | ===== Taking the User Interface Offline ===== | ||
- | If you simply stop the Solr server, users attempting to access your VuFind | + | If you simply stop the Solr server, users attempting to access your VuFind® |
---- struct data ---- | ---- struct data ---- | ||
properties.Page Owner : | properties.Page Owner : | ||
---- | ---- | ||
administration/starting_and_stopping_solr.1678449028.txt.gz · Last modified: 2023/03/10 11:50 by demiankatz