Jump to Navigation

253 - How to install Apache Solr 3.6 for Drupal 7

Solr is the popular, blazing fast open source enterprise search platform from the Apache Lucene project.
Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering,
database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly
scalable, providing distributed search and index replication, and it powers the search and navigation
features of many of the world's largest internet sites.

1. Install Java

# yum install java-1.6*

2. Install Apache Solr

# cd /usr/local

# wget http://apache.mirrors.tds.net/lucene/solr/3.6.1/apache-solr-3.6.1.zip
# unzip apache-solr-3.6.1.zip

# ln -s ./apache-solr-3.6.1 ./solr

# cd ./solr/example
# java -jar start.jar &

3. Sample Indexing

# cd /usr/local/solr/example/exampledocs
# sh post.sh *.xml

http://myserver01:8983/solr/admin/

http://myserver01:8983/solr/browse

4. Start Apache Solr automatically

# vi /etc/init.d/solr

 

#!/bin/sh

# Starts, stops, and restarts Apache Solr.
#
# chkconfig: 35 92 08
# description: Starts and stops Apache Solr

SOLR_DIR="/usr/local/solr/example"
JAVA_OPTIONS="-Xmx2048m -DSTOP.PORT=8079 -DSTOP.KEY=mustard -jar start.jar"
LOG_FILE="/var/log/solr.log"
JAVA="/usr/bin/java"

case $1 in
    start)
        echo "Starting Solr"
        cd $SOLR_DIR
        $JAVA $JAVA_OPTIONS 2> $LOG_FILE &
        ;;
    stop)
        echo "Stopping Solr"
        cd $SOLR_DIR
        $JAVA $JAVA_OPTIONS --stop
        ;;
    restart)
        $0 stop
        sleep 1
        $0 start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 1
        ;;
esac

# chmod 755 /etc/init.d/solr
# chkconfig --add solr

5. Copy config xml files

Drupal Apache Solr integration module provides some xml & txt files.Before copy you take a back ups

# cd /usr/local/solr/example/solr/conf

# tar zcvf bkup.tar ./*

cp $solr-module/schema.xml, solrconfig.xml, protwords.txt ./

6. Start Solr Server

# service solr start
# service solr stop
# service solr restart

6. Something wrong.

Please check linux firewall & SELinux.

* Fully Disabling SELinux

# vi /etc/selinux/config
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

System Reboot.

 

 

 

 

 

drupal:


Main menu 2

Story | by Dr. Radut