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
- 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)
- Start tomcat to decompress SOLR. War in webapps to generate the SOLR directory (an error will be reported first)
- 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
- 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