Installation

This document describes how to install the Search Service software contained in the search-service package. The following topics can be found in this section:

System Requirements

This section details the system requirements for installing and operating the Search Service.

Java Runtime Environment

The Search Service was developed using Java and will run on any platform with a supported Java Runtime Environment (JRE). The software was specifically compiled for and tested in Java version 1.8. The following commands test the local Java installation in a UNIX-based environment:

% which java
/usr/bin/java

% java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
        

The first command above checks whether the java executable is in the environment's path and the second command reports the version. If Java is not installed or the version is not at least 1.8, Java will need to be downloaded and installed in the current environment. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, the Java software can be downloaded from the Oracle Java Download page. The suggested software package is the Java Standard Edition (SE) 8, either the JDK or the JRE package. The JDK package is not necessary to run the software but could be useful if development and compilation of Java software will also occur in the current environment.

Java Application Server

The Search Service requires a Java application server for hosting the web application. The suggested application server for this release is Apache Tomcat with a minimal version of 7.0.X. Consult the local system administrator for installation of this software. For the do-it-yourself crowd, see the Tomcat Deployment document for installation and configuration details. If viewing this document from the search-service package, view the Tomcat Deployment document from the Engineering Node site.

The top-level directory where Apache Tomcat is installed (i.e. the directory containing the webapps and conf sub-directories) will be referenced in these instructions as $TOMCAT_HOME.

Unpacking the Package

Download the search-service package from the PDS FTP site. The binary distribution is available in identical zip or tar/gzip packages. The installation directory may vary from environment to environment but in UNIX-based environments it is typical to install software packages in the /usr/local directory and in Windows-based environments it is typical to install software packages in the C:\Program Files directory. Unpack the selected binary distribution file with one of the following commands:

% unzip search-service-1.13.0-bin.zip
or
% tar -xzvf search-service-1.13.0-bin.tar.gz
      

Note: Depending on the platform, the native version of tar may produce an error when attempting to unpack the distribution file because many of the file paths are greater than 100 characters. If available, the GNU version of tar will resolve this problem. If that is not available or cannot be installed, the zipped package will work just fine in a UNIX environment.

The commands above result in the creation of the search-service-1.13.0 directory with the following directory structure:

  • LICENSE.txt

    The copyright notice from the California Institute of Technology detailing the restrictions regarding the use and distribution of this software. Although the license is strictly worded, the software has been classified as Technology and Software Publicly Available (TSPA) and is available for anyone to download and use.

  • README.txt

    A README file directing the user to the available documentation for the project.

  • doc/

    This directory contains a local web site with the Search Service documentation, javadoc, unit test results and other configuration management related information. Just point the desired web browser to the index.html file in this directory.

  • experimental/

    This directory contains the configuration for the experimental core for Solr. This directory is intended for development and testing purposes only, and can be ignored.

  • pds/

    This directory contains the configuration for the Solr core for the PDS Search. This directory path is the SEARCH_HOME referenced in the Search Core Operation documentation

  • search-service.war

    This WAR file is the Solr software application to be deployed to Tomcat. It also contains the jars used by the Solr software.

  • solr.xml

    This XML file provides the basic, initial configuration for the Solr software.

Deploying the Application

The Search Service includes the configuration for Solr as well as the Java extensions written to support the PDS Search Protocol and PDAP Handler. In order to deploy Solr with the Search Service configuration, please complete the following procedure:

Initial Installation

  1. Create a symbolic link to the Search Service installation directory to provide an easier method of upgrade in the future. The following demonstrates how to create this symbolic link:
    % ln -s /usr/local/search-service-1.13.0 /usr/local/search-service
                
  2. Append to the CATALINA_OPTS and JAVA_OPTS environment variables by adding the following line to the script specified below:

    Unix or Linux: $TOMCAT_HOME/bin/setenv.sh

    CATALINA_OPTS="${CATALINA_OPTS} \
                  -Dsolr.pds.home=/usr/local/search-service"
    
    JAVA_OPTS="${JAVA_OPTS} -Dlog4j.configuration=\
              file:///usr/local/search-service/log4j.properties"
    JAVA_OPTS="${JAVA_OPTS} -Dlog4j.debug=true"
                

    For more information on the $TOMCAT_HOME/bin/setenv.sh script, see the General Configuration / Environment Configuration section of the Tomcat Deployment document. If viewing this document from the search-service package, view the Tomcat Deployment document from the Engineering Node site.

    Windows: $TOMCAT_HOME\bin\setenv.bat

    set CATALINA_OPTS=%CATALINA_OPTS% -Dsolr.pds.home=C:\Users\local\search-service
    
    set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.configuration=file:///Users/local/search-service/log4j.properties
    set JAVA_OPTS=%JAVA_OPTS% -Dlog4j.debug=true
                
  3. Restart Tomcat Server
  4. Copy the WAR file to the $TOMCAT_HOME/webapps directory. To copy the WAR file directly, perform the following command:

    % cp /usr/local/search-service/search-service.war $TOMCAT_HOME/webapps
                
  5. Test installation by pointing your browser to http://localhost:8080/search-service/ (Domain and port will vary according to Tomcat configuration)

Upgrade To New Version

  1. Shutdown Tomcat Server
  2. Change the Search Service symbolic link to new location:
    % rm /usr/local/search-service
    
    % ln -s /usr/local/search-service-x.x.x /usr/local/search-service
                
  3. Delete the previous version's WAR file from the $TOMCAT_HOME/webapps directory. Delete the WAR file and its associated directory with the following commands:

    % rm -r $TOMCAT_HOME/webapps/search-service 
    % rm $TOMCAT_HOME/webapps/search-service.war
                
  4. Copy the WAR file to the $TOMCAT_HOME/webapps directory. To copy the WAR file directly, perform the following command:

    % cp /usr/local/search-servicesearch-service.war $TOMCAT_HOME/webapps
                
  5. Start Tomcat Server
  6. Test installation by going to http://localhost:8080/search-service/ (Domain and port will vary according to Tomcat configuration)

Security

The Solr software includes an end point to update the index. This introduces a security vulnerability by allowing someone to modify the index without securing it. The preferred method of security is to only allow updates to come from the local machine (localhost). To do so, open the Apache Tomcat configuration file, $TOMCAT_HOME/conf/server.xml, for editing, and find the Host section in the document that looks similar to the following:

<Host name="localhost"  appBase="webapps"
      unpackWARs="true" autoDeploy="true">
  .
  .
  .
</Host>
      

Within this section, add the following code, which should be modified according to your specific installation. The following assumes that the Search Service software is located at the Tomcat base level directory (i.e. http://localhost/search-service):

<Context path="/search-service/pds/update" docBase="" >
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1" />
</Context>
      

The IP address 127.0.0.1 represents the localhost IP address. This can be modified to be any IP address of the machine you would like to have update access to the Search Service.

Common Errors

HTTP 404 - Requested Resource Not Available

This error means the application failed to install correctly. The following are potential mitigation strategies:

  • Verify domain and port are correct for the local Tomcat installation.
  • Verify paths denoted for $TOMCAT_HOME/conf/Catalina/localhost/search-service.xml and CATALINA_OPTS are correct.
  • View $TOMCAT_HOME/logs/catalina.current-date.log for information on potential causes of the failed deployment.

Other Errors

For other errors that arise while testing the installation, see the Operate - Common Errors