Vufind: The library OPAC meets Web 2.0


 

Starting and Stopping VuFind

Once VuFind is installed, it will only respond to search requests if its Solr back-end is active. This page explains how to turn the server on and off and how to automate the process if you wish.

Starting VuFind Manually

Linux Method

To start VuFind under Linux, just switch to the directory where you installed the program and run this command:

  ./vufind.sh start

Note: If this doesn't work, make sure that the vufind.sh script has execute permissions:

  chmod +x vufind.sh

Note: If you previously rebooted your system without manually stopping VuFind, the script may mistakenly believe that it is still running. In this case, a manual restart should solve the problem.

Windows Method

Starting with VuFind 1.0RC2, VuFind includes a Windows batch file to run VuFind. Just follow these steps:

  • At a command prompt, switch to your VuFind directory.
  • Type: vufind start

Note that the vufind.bat file which allows this command to work is created automatically as part of the install.bat setup process. If you did not install VuFind using install.bat, the file may be missing. You can re-run the install process to solve the problem.

If you are using an earlier version of VuFind, you will have to start the server manually. From the command line, run:

  cd \vufind\solr\jetty\
  java -Dsolr.solr.home=c:\vufind\solr -Xmx1G -Xms1G -jar start.jar

Note: The above command assumes you want to dedicate 1 Gig of memory to the Java engine. Change the values as needed (see the performance page for details). This is especially important on lower end machines that will quickly freeze up during indexing if no memory limit is established.

Stopping VuFind Manually

Linux Method

To take the server offline, switch to the VuFind directory and type:

  ./vufind.sh stop

Windows Method

To stop a manually-started VuFind instance under Windows, open the command prompt window where the server is running and hit Ctrl-C. This will cause the process to shut down.

If you are running VuFind through Jetty as a service, you can stop the server through the Services control in the Administrative Tools area of Control Panel.

Restarting VuFind Manually

Linux Method

Restarting VuFind under Linux is much the same as starting it. Just switch to the VuFind directory and type:

  ./vufind.sh restart

Windows Method

There is no graceful way to restart a manually-started VuFind instance under Windows. Just follow the manual “stop” and “start” procedures described above.

If you are running VuFind through Jetty as a service, you can restart the server through the Services control in the Administrative Tools area of Control Panel.

Killing an Unresponsive VuFind Process

Solr is usually very stable, especially if you restart it regularly. However, it will occasionally crash, especially if it does not have enough memory available (see the Performance page for advice on memory tuning). When this happens, you may have to manually kill the crashed process.

Linux Method

First, use the ps command to get a list of running Java processes:

ps aux | grep java

You will see something like this:

dkatz     1326  0.3  4.3 1273128 173932 ?      Sl   08:03   0:03 /usr/lib/jvm/default-java/bin/java -server -Xms1024m -Xmx1024m -XX:+UseParallelGC -XX:NewRatio=5 -Dsolr.solr.home=/usr/local/vufind/solr -Djetty.logs=/usr/local/vufind/solr/jetty/logs -Djetty.home=/usr/local/vufind/solr/jetty -jar /usr/local/vufind/solr/jetty/start.jar /usr/local/vufind/solr/jetty/etc/jetty.xml

The number after your username (“dkatz” in the example above) is the process ID. You can kill the process like this:

sudo kill -9 [process ID number]

If you repeat the ps command, you should no longer see VuFind running.

Note that because you didn't stop VuFind cleanly, the ./vufind.sh script may be confused the next time you try to start it up, thinking that VuFind is already running. In this case, just perform a ”./vufind.sh restart” instead of ”./vufind.sh start” to get things back to normal.

Windows Method

[I have never experienced a Solr crash under Windows, but I imagine that Windows Task Manager can be used to clear up any problems. Does anyone with experience in this area care to comment? – Demian]

Running VuFind Automatically

If you don't want to have to manually start and stop VuFind every time you turn on or shut down your server, you can set it up to run automatically.

Linux Method

You can set up VuFind to run as a daemon. To do so, create a wrapper script in /etc/init.d/vufind:

#!/bin/sh
### BEGIN INIT INFO
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: VuFind init script
### END INIT INFO
cd /usr/local/vufind
./vufind.sh $*

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.

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.

Windows Method

Jetty (the wrapper that allows Solr to run) can be set up as a Windows service. First we need to change a couple of config settings, one is required, the others will just help. Assuming an install location of c:\vufind, edit c:\vufind\solr\jetty\bin\jetty-service.conf. Find the lines

  wrapper.java.additional.1=-Djetty.home=../
  wrapper.java.additional.2=-Djetty.logs=../logs
  wrapper.java.initmemory=3
  wrapper.java.maxmemory=64

And change them to:

  wrapper.java.additional.1=-Djetty.home=../
  wrapper.java.additional.2=-Djetty.logs=../logs
  wrapper.java.additional.3=-Dsolr.solr.home=c:\vufind\solr
  wrapper.java.initmemory=64
  wrapper.java.maxmemory=256

You'll notice the first two lines haven't changed (they were just for reference), and the third line is passing Jetty Solr's home location. The last two lines control how much memory the JVM Jetty will be running inside of has access to. The default settings limit the JVM to 64mb, and we're going to need a lot more to comfortably run a Solr index. 256mb is still low for a server, but it's enough to play around on a laptop in comfort.

Now it's time to install the service. Open a command window and run the following:

  cd \vufind\solr\jetty\bin
  Jetty-Service.exe -i jetty-service.conf

NOTE: If you are running Windows Vista the above will still fail with 'access denied' unless you open the command prompt with admin rights. START > Programs > Accessories. Right-click on 'Command Prompt' and choose 'Run as administrator'.

Taking the User Interface Offline

If you simply stop the VuFind server, users attempting to access your VuFind site will encounter error messages. If you are planning an outage, you can take the site more gracefully offline by adjusting the “available” setting in the ”[System]” section of your web/conf/config.ini file.

 
starting_and_stopping_vufind.txt · Last modified: 2011/04/18 09:32 by demiankatz
 
Recent changes RSS feed Driven by DokuWiki