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
- <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"?>
- <Context docbase = "D: \ work-tools \ webserver \ tomcat-6.0.37 \ webapps \ SOLR. War" DEBUG = "0" crosscontext = "true">
- ? <Environment name = "SOLR/home" type = "Java. Lang. String" value = "C: \ SOLR-Tomcat \ SOLR" override = "true"/>
- </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
- <Connector Port = "8080" protocol = "HTTP/1.1"
- Connectiontimeout = "20000"
- 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
- Severe: exception starting filter solrrequestfilter
- 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