SOLR.INSTALL 2.54 KB
################
# SOLR INSTALL #
################
#
# Author Jean-François Rey
# Version : 1.0
# Date : 18/07/2013
#

1/ Edit install.sh and put CONFPASS=1

2/ Run install.sh, this will check tomcat is installed, download and untar otmedia SOLR DB and ask for solr service info.

3/ Configure Tomcat and SOLR

SOLR_OTMEDIA_PATH=OTMEDIA_PATH/tools/SOLR/otemdia-2013-04

    3.1/ Set context file
         ----------------

    - in SOLR_OTMEDIA_PATH/solr/otmedia-document/solr-tomcat-deploy/solr-otmedia-document.xml
    change DocBase to  DocBase="SOLR_OTMEDIA_PATH/solr/otmedia-document/apache-solr-3.5.0.war"
    and value to value="SOLR_OTMEDIA_PATH/solr/otmedia-document/"

    - in SOLR_OTMEDIA_PATH/solr/otmedia-multimedia/solr-tomcat-deploy/solr-otmedia-multimedia.xml
    change DocBase to  DocBase="SOLR_OTMEDIA_PATH/solr/otmedia-multimedia/apache-solr-3.5.0.war"
    and value to value="SOLR_OTMEDIA_PATH/solr/otmedia-multimedia/"

    3.2/ SOLR data configuration 
         -----------------------

    - in SOLR_OTMEDIA_PATH/solr/otmedia-document/conf/solrconfig.xml
    change datadir (solr.data.dir) to SOLR_OTMEDIA_PATH/index/otmedia-document/

    - in SOLR_OTMEDIA_PATH/solr/otmedia-multimedia/conf/solrconfig.xml
    change datadir (solr.data.dir) to SOLR_OTMEDIA_PATH/index/otmedia-multimedia/

    3.3/ Add SOLR DB to Tomcat
         ---------------------

    - in tomcat/Catalina/localhost/ (mainly in /etc/tomcat/Catalina/localhost or /var/lib/tomcat/conf/Catalina/localhost)
    run : $> ln -s SOLR_OTMEDIA_PATH/solr/otmedia-document/solr-tomcat-deploy/solr-otmedia-document.xml solr-otmedia-document.xml
    run : $> ln -s SOLR_OTMEDIA_PATH/solr/otmedia-multimedia/solr-tomcat-deploy/solr-otmedia-multimedia.xml solr-otmedia-document.xml

4/ Tomcat trouble

    4.1/ SOLR use a lot of memory, you need to increase java heap space !
         -------------------------

    - in catalina.sh (/usr/share/tomcat/bin)
    add CATALINA_OPTS="$CATALINA_OPTS -Xms256 -Xmx512m"

    4.2/ Directory permissions
         ---------------------

    - SOLR_OTMEDIA_PATH and subdirectory (and files) need to belong to tomcat group (and tomcat user if the default user don't belong to tomcat group).
    chgrp -r tomcat7 otmedia-2013-04
    chmod g+rx otmedia-2013-04

5/ Test

You can test those requests (change ip and port):
http://localhost:8080/solr-otmedia-multimedia/select?q=test+bonus+&fq=docDate:[2011-12-30T00\:00\:01Z+TO+2012-01-01T23\:59\:59Z]
http://localhost:8080/solr-otmedia-document/select?q=test+bonus+&fq=docDate:[2011-12-30T00\:00\:01Z+TO+2012-01-01T23\:59\:59Z]