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 revisionNext revisionBoth sides next revision | ||
administration:starting_and_stopping_solr [2017/08/17 09:03] – [Linux (systemd) Method] - permission for solr user xmorave2 | administration:starting_and_stopping_solr [2023/03/10 11:50] – demiankatz | ||
---|---|---|---|
Line 4: | Line 4: | ||
===== Starting Solr Manually ===== | ===== Starting Solr Manually ===== | ||
- | |||
- | |||
==== Linux Method ==== | ==== Linux Method ==== | ||
Line 21: | Line 19: | ||
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. | ||
+ | === Limit Warnings === | ||
+ | |||
+ | Starting with Solr 7.3.1, you may see warnings on startup resembling: | ||
+ | |||
+ | < | ||
+ | *** [WARN] *** Your open file limit is currently 1024. | ||
+ | It should be set to 65000 to avoid operational disruption. | ||
+ | If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh | ||
+ | *** [WARN] *** Your Max Processes Limit is currently 15058. | ||
+ | It should be set to 65000 to avoid operational disruption. | ||
+ | If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh | ||
+ | </ | ||
+ | |||
+ | This is warning of some default settings that could impact the performance of your Solr instance. On some Linux platforms, this can be addressed by editing the / | ||
+ | |||
+ | < | ||
+ | username | ||
+ | username | ||
+ | username | ||
+ | username | ||
+ | </ | ||
+ | |||
+ | (where " | ||
+ | |||
+ | 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 ==== | ||
Line 105: | Line 153: | ||
If you don't want to have to manually start and stop Solr every time you turn on or shut down your server, you can set it up to run automatically. | If you don't want to have to manually start and stop Solr every time you turn on or shut down your server, you can set it up to run automatically. | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ==== Linux (init.d) Method ==== | ||
- | |||
- | 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 2.x, when the Solr script was still named vufind.sh instead of solr.sh; if running VuFind 3.0 or newer, you may wish to replace " | ||
- | |||
- | < | ||
- | #!/bin/sh | ||
- | ### BEGIN INIT INFO | ||
- | # Default-Start: | ||
- | # Default-Stop: | ||
- | # Description: | ||
- | ### END INIT INFO | ||
- | cd / | ||
- | ./vufind.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. | ||
==== Linux (systemd) Method ==== | ==== Linux (systemd) Method ==== | ||
Line 163: | Line 158: | ||
// Thanks to [[https:// | // Thanks to [[https:// | ||
- | Some newer flavors of Linux (such as CentOS 7) use [[https:// | + | Most modern |
To automate Solr with systemd: | To automate Solr with systemd: | ||
- | * create the user " | + | * [[administration: |
- | * add permission for solr directory to this user: | + | * add permission for the solr directory to this user if you have not already: |
< | < | ||
* create new file called / | * create new file called / | ||
- | |||
- | In VuFind 2.x, the contents of the file should be as follows: | ||
< | < | ||
- | Description=VuFind Starter | + | [Unit] |
- | After=network.target httpd.service mariadb.service | + | After=network.target |
- | + | ||
- | [Service] | + | |
- | Type=forking | + | |
- | ExecStart=/ | + | |
- | PIDFile=/ | + | |
- | User=solr | + | |
- | ExecStop=/ | + | |
- | + | ||
- | # Java responds to a SIGTERM by returning with exit code 143 which leads to " | + | |
- | SuccessExitStatus=143 | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=multi-user.target | + | |
- | </ | + | |
- | + | ||
- | In VuFind 3.0, the contents of the file should be as follows. It will work with the official VuFind 3 deb package (tested on Ubuntu 16.04). | + | |
- | + | ||
- | < | + | |
- | After=network.target | + | |
[Service] | [Service] | ||
Type=forking | Type=forking | ||
ExecStart=/ | ExecStart=/ | ||
- | PIDFile=/ | + | PIDFile=/ |
User=solr | User=solr | ||
ExecStop=/ | ExecStop=/ | ||
Line 209: | Line 183: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
</ | </ | ||
+ | |||
+ | The above example should work for VuFind 7.0 and later using the official VuFind deb package (this has been tested on Ubuntu). For compatibility with VuFind 3.0 through 6.0, simply change " | ||
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 230: | Line 206: | ||
Alternatively, | Alternatively, | ||
- | ==== Windows | + | ==== Linux (init.d) |
- | === VuFind 1.x === | + | :!: 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. |
- | Jetty (the wrapper that allows | + | You can set up Solr to run as a daemon. To do so, create |
- | wrapper.java.additional.1=-Djetty.home=../ | + | :!: 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 |
- | wrapper.java.additional.2=-Djetty.logs=../logs | + | |
- | wrapper.java.initmemory=3 | + | |
- | wrapper.java.maxmemory=64 | + | |
- | And change them to: | + | :!: 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 " |
- | wrapper.java.additional.1=-Djetty.home=../ | + | :!: Newer versions of Solr do not like to be run by the root user; you may need to either add " |
- | wrapper.java.additional.2=-Djetty.logs=../logs | + | |
- | wrapper.java.additional.3=-Dsolr.solr.home=c: | + | |
- | wrapper.java.initmemory=64 | + | |
- | wrapper.java.maxmemory=256 | + | |
- | You'll notice the first two lines haven' | + | < |
+ | #!/bin/sh | ||
+ | ### BEGIN INIT INFO | ||
+ | # Provides: vufind | ||
+ | # Required-Start: | ||
+ | # Required-Stop: | ||
+ | # Default-Start: | ||
+ | # Default-Stop: | ||
+ | # Description: | ||
+ | ### END INIT INFO | ||
+ | cd / | ||
+ | ./solr.sh $* | ||
+ | </ | ||
- | Now it's time to install | + | // 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 |
- | | + | // Note: If your VuFind instance is installed somewhere other than / |
- | Jetty-Service.exe -i jetty-service.conf | + | |
- | NOTE: If you are running Windows Vista the above will still fail with ' | + | Make sure that the script is executable (sudo may be needed on the command |
- | === VuFind 2.x === | + | < |
+ | chmod +x / | ||
+ | </ | ||
- | The Jetty service | + | You will then need to add the script to your runlevel configuration (generally |
- | February 2015: Solr was successfully configured as a service on both a Windows 7 test box running under XAMPP and a production Windows 8 R2 server using the following: http:// | + | On RedHat (including Fedora): chkconfig |
+ | On Debian (including Ubuntu): update-rc.d vufind | ||
+ | |||
+ | If this doesn' | ||
+ | |||
+ | === Interacting with Solr After Automation === | ||
+ | |||
+ | On some platforms, | ||
< | < | ||
- | SolrService.exe // | + | service |
- | --Install=C: | + | service |
- | --LogPath=C: | + | service |
- | --LogLevel=Debug --StdOutput=auto --StdError=auto | + | service |
- | --StartMode=java --StopMode=java --Jvm=auto | + | |
- | ++JvmOptions=-Djetty.home=C: | + | |
- | ++JvmOptions=-DSTOP.KEY=stopsolr ++JvmOptions=-Djetty.logs=C: | + | |
- | ++JvmOptions=-Dorg.eclipse.jetty.util.log.SOURCE=true | + | |
- | ++JvmOptions=-XX: | + | |
- | --StartClass=org.eclipse.jetty.start.Main ++StartParams=OPTION=ALL | + | |
- | ++StartParams=C: | + | |
- | --StopClass=org.eclipse.jetty.start.Main | + | |
- | ++StopParams=--stop ++JvmOptions=-Dsolr.solr.home=C: | + | |
- | --StartPath=C: | + | |
</ | </ | ||
- | // Note: the above should | + | //(" |
- | Important! | + | If service is available, it is the preferred way of starting and stopping Solr after automation. |
- | Judy Drescher, Molloy College | + | ==== Windows Method ==== |
- | + | ||
- | === VuFind 3.x === | + | |
- | Now that Solr can be started as a background process from the command line, it should be easier to manage it from within Windows; however, detailed instructions have not been developed as of this writing. Please feel free to contribute your own recommendations! | + | As of VuFind 3.0, Solr can be started as a background process from the command line, so it should be possible |
===== Taking the User Interface Offline ===== | ===== Taking the User Interface Offline ===== | ||
Line 295: | Line 272: | ||
If you simply stop the Solr server, users attempting to access your VuFind site will encounter error messages. | If you simply stop the Solr server, users attempting to access your VuFind site will encounter error messages. | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
administration/starting_and_stopping_solr.txt · Last modified: 2023/10/24 13:47 by demiankatz