Install SOLR under Tomcat

Source: Internet
Author: User
Tags solr

SOLR version: 4.10.1

Tomcat version: 7.0.23

JDK version: 1.7.0 _ 01

Note: SOLR explicitly requires JDK 1.7 or later.

Install Tomcat and JDK.

Download SOLR: http://lucene.apache.org/solr/downloads.html

  1. Decompress the solr-4.10.1 to: solr-4.10.1 \ example \ webapps \ SOLR. war is deployed in Tomcat, that is, copy SOLR. war to E: \ Server \ apache-Tomcat-SOLR \ webapps (I changed my tomcat name to Apache-Tomcat-SOLR)
  2. Start tomcat to decompress SOLR. War in webapps to generate the SOLR directory (an error will be reported first)
  3. Create a folder to store SOLR configuration files such as E:/SOLR/home and copy all files from solr-4.10.0 \ example \ SOLR to this directory
  4. Modify E:/SOLR/home/collection1/CONF/solrconfig. xml
    <dataDir>${solr.data.dir:}</dataDir>  

Is:

<dataDir>${solr.data.dir:E:/solr/home/collection1/data}</dataDir>  

 

5. copy the jar package under solr-4.10.1 \ example \ Lib \ ext to Apache-Tomcat-SOLR \ webapps \ SOLR \ WEB-INF \ Lib (because the sl4j package will be used, not in the original war)

 

6. modify \ webapps \ SOLR \ WEB-INF \ WEB. XML in

<!--      <env-entry>         <env-entry-name>solr/home</env-entry-name>         <env-entry-value>/put/your/solr/home/here</env-entry-value>         <env-entry-type>java.lang.String</env-entry-type>      </env-entry>     --> 

 

Change

<env-entry>       <env-entry-name>solr/home</env-entry-name>       <env-entry-value>E:/solr/home</env-entry-value>       <env-entry-type>java.lang.String</env-entry-type>    </env-entry>

7. Create the file classes folder under Apache-Tomcat-SOLR \ webapps \ SOLR \ WEB-INF,

And copy solr-4.10.1 \ example \ resources \ log4j. properties to: APACHE-Tomcat-SOLR \ webapps \ SOLR \ WEB-INF \ Classes

8. Add a startup log to warn that the jar package cannot be found.

Solrconfig. xml contains some jar package configuration items, such

 <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" />  <lib dir="../../../dist/" regex="solr-cell-\d.*\.jar" />

You need to modify the path here, or

Do not create a new solr_home E:/SOLR/home; directly use the decompressed SOLR file to direct all SOLR \ home configurations to the decompressed file E: \ solr-4.10.1 \ example \ SOLR

 

Finally, start Tomcat and access http: // localhost: 8080/SOLR/

There was a problem that I had been delayed for a long time. When I started tomcat, the error filterstart was reported. I always thought it was a jar package conflict,

The result turns out that catalina_home is not configured. Generally, you can directly throw the war package you typed into Tomcat without configuring Tomcat environment variables,

I don't know if there is a configuration in SOLR that requires catalina_home. Add the catalina_home environment variable and start it successfully!

Install SOLR under Tomcat

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.