SOLR Study Notes-deploy and run SOLR on Tomcat

Source: Internet
Author: User
Tags apache solr solr

Window7

Jdk1.6.0 _ 14

Solr-4.7.2

Tomcat-6.0.37

The installation and configuration of SOLR home in SOLR mainly introduces the configuration based on JNDI. For other methods, refer to SOLR wiki.

Configuration Based on JNDI

1: first create a SOLR running directory.

C: \ SOLR-Tomcat

Copy the SOLR directory under D: \ work-tools \ SOLR \ solr-4.7.2 \ solr-4.7.2 \ example \ In the decompressed packageC: \ SOLR-Tomcat.

2: Create a JNDI File

Create the SOLR. xml file under Tomcat's D: \ work-tools \ webserver \ tomcat-6.0.37 \ conf \ Catalina \ localhost.

The content is as follows:

[HTML]View plaincopy
  1. <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"?>
  2. <Context docbase = "D: \ work-tools \ webserver \ tomcat-6.0.37 \ webapps \ SOLR. War" DEBUG = "0" crosscontext = "true">
  3. ? <Environment name = "SOLR/home" type = "Java. Lang. String" value = "C: \ SOLR-Tomcat \ SOLR" override = "true"/>
  4. </Context>


3: Modify the URI encoding of server. xml

Edit server. XML in Tomcat's D: \ work-tools \ webserver \ tomcat-6.0.37 \ conf

[HTML]View plaincopy
  1. <Connector Port = "8080" protocol = "HTTP/1.1"
  2. Connectiontimeout = "20000"
  3. Redirectport = "8443" uriencoding = "UTF-8"/>


4: deploy the SOLR. War package

Change the solr-4.7.2 under D: \ work-tools \ SOLR \ solr-4.7.2 \ solr-4.7.2.war \ DIST to SOLR. copy war to D: \ work-tools \ webserver \ tomcat-6.0.37 \ webapp.

5: configuration log

This step is critical, and the following error will occur if not configured

Error filterstart

Context [/SOLR] startup failed due to previous errors

I can't see any errors here. I only know that some configuration errors have occurred before starting Context/SOLR, but I don't know what configurations are, at this time, you can view the localhost.2014-08-23.log in the \ tomcat-6.0.37 \ logs directory of Tomcat. We will see the detailed error information.

[HTML]View plaincopy
  1. Severe: exception starting filter solrrequestfilter
  2. Java. lang. noclassdeffounderror: failed to initialize Apache SOLR: cocould not find necessary slf4j logging jars. if using jetty, The slf4j logging jars need to go in the jetty lib/EXT directory. for other containers, the corresponding directory shoshould be used. for more information, see: http://wiki.apache.org/solr/SolrLogging

Here it is clear that slf4j jar is not, we go to the solr-4.7.2 \ example \ Lib \ ext to test all the packages under the Tomcat \ lib directory.

6: start Tomcat


6: view the SOLR admin pageHttp: // 127.0.0.1: 8080/SOLR

Summary: These configurations are described on SOLR Wiki and are classified by Linux and Windows. In fact, SOLR's real production environment must be deployed on Linux, SOLR provides shell scripts for testing, management, and maintenance, which is very convenient for Linux O & m solr.

SOLR Study Notes-deploy and run SOLR on 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.