Install and deploy SOLR under Linux

Source: Internet
Author: User
Tags solr tomcat server log4j

First, installation Preparation

Operating system: CentOS 6.5

Tomcat version: apache-tomcat-7.0.54.tar.gz

SOLR version: Solr-4.9.0.tgz

Ii. Deployment Implementation

  • Install Tomcat: slightly .....
  • Then go to the Tomcat/bin folder, execute the./startup.sh startup script, and then access Tomcat's url:http://ip:8080 in the browser, such as deploying Tomcat successfully.

  • Install SOLR: Solr-4.9.0.tgz compressed package Last to the Linux/opt directory, use the command line to extract the solr-4.9.0, and rename the folder to Solr, and then create the Solr folder as SOLR's deployment root directory, created in SOLR/ Usr/local/solr/solr-index directory that is stored as an index file:
    TAR-ZXVF solr-4.9.0.tgzmv solr-4.9.0 solrmkdir-p/USR/LOCAL/SOLRCD/USR/LOCAL/SOLR; mkdir solr-indexcp-r/opt/solr/example/solr/*     /USR/LOCAL/SOLR

    Copy all the contents under the/opt/solr/example/solr/folder to the Solr folder and enter/usr/local/solr/collection1/conf with a solrconfig.xml file and open:

    <lib dir= ". /.. /.. /contrib/extraction/lib "regex=". *\.jar "/>  <lib dir=". /.. /.. /dist/"regex=" Solr-cell-\d.*\.jar "/>   <lib dir=". /.. /.. /contrib/clustering/lib/"regex=". *\.jar "/>  <lib dir=". /.. /.. /dist/"regex=" Solr-clustering-\d.*\.jar "/>   <lib dir=". /.. /.. /contrib/langid/lib/"regex=". *\.jar "/>  <lib dir=". /.. /.. /dist/"regex=" Solr-langid-\d.*\.jar "/>   <lib dir=". /.. /.. /contrib/velocity/lib "regex=". *\.jar "/>  <lib dir=". /.. /.. /dist/"regex=" Solr-velocity-\d.*\.jar "/>
  •  <datadir>${solr.data.dir:}</datadir> 

    Modified to:

     <!--<lib dir= ".. /.. /.. /contrib/extraction/lib "regex=". *\.jar "/> <lib dir=". /.. /.. /dist/"regex=" Solr-cell-\d.*\.jar "/> <lib dir=". /.. /.. /contrib/clustering/lib/"regex=". *\.jar "/> <lib dir=". /.. /.. /dist/"regex=" Solr-clustering-\d.*\.jar "/> <lib dir=". /.. /.. /contrib/langid/lib/"regex=". *\.jar "/> <lib dir=". /.. /.. /dist/"regex=" Solr-langid-\d.*\.jar "/> <lib dir=". /.. /.. /contrib/velocity/lib "regex=". *\.jar "/> <lib dir=". /.. /.. /dist/"regex=" Solr-velocity-\d.*\.jar "/>--> 
     <datadir >${solr.data.dir:/usr/local/solr/solr-index}</datadir> 

    Enters the dist directory in the/OPT/SOLR catalog, There is a Solr-4.9.0.war bag, copied to your tomcat under the WebApps directory (~/tomcat7/webapps), and renamed to Solr.war, launched Tomcat will automatically unzip the deployment of Solr.war package, and extracted to the SOLR directory under the directory, this directory is a standard Web project directory.

  • To enter ~/tomcat7/webapps/solr/web-inf, modify the Web. xml file as follows:

    <env-entry>       <env-entry-name>solr/home</env-entry-name>       <env-entry-value>/home/ Hadoop2/solrhome</env-entry-value>       <env-entry-type>java.lang.String</env-entry-type>    </env-entry>

    You need to copy some jar packages and log4j configuration files: Copy all jars from ~/solr/example/lib/ext and copy ~/solr/example/resources/log4j.properties to ~/tomcat7/ Under Lib.

  • Start the SOLR server: After completing the above configuration, reboot the Tomcat server and then access the URL:HTTP://IP:8080/SOLR of the SOLR server, if you see the following interface, the deployment is successful:

Install and deploy SOLR under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.