How to run Solr 4 in Tomcat locally?

后端 未结 6 1114
[愿得一人]
[愿得一人] 2021-02-07 09:58

I\'ve been trying to set up Solr 4.3 on my home PC (in Tomcat 7) but it doesn\'t run. I have set up Tomcat and deployed the solr.war file which both unpacks and sho

6条回答
  •  天涯浪人
    2021-02-07 10:28

    1. Download latest solr-4.x.zip file.
    2. Extract zip file somewhere like C:\solr setup.
    3. Apache Tomcat (version greater than 5) and Java 6 or greater should be installed. Copy solr-4.x.war file from “C:\solr setup\solr-4.3.0\dist” to “Apache Tomcat” webapps folder most probably in C:\Program Files\Apache...\Tomcat...\webapps\ and rename copied war file to some meaningful name like solrTest.Start Tomcat. If already running then restart Tomcat. New folder with same name as of war file (solrTest) will be created.
    4. Stop Tomcat. Copy bin and collection1 folders from C:\solr setup\solr-4.x\example\solr to C:\Program Files\Apache ...\Tomcat...\webapps\solrTest.
    5. Copy all jars from C:\solr setup\solr-4.x\example\lib\ext to C:\Program Files\Apache...\Tomcat...\lib. SOLR 4.x will use these jars for logging.
    6. Create xml file in C:\Program Files\Apache...\Tomcat...\conf\Catalina\localhost\ with same name as of war file (solrTest.xml) with contents as given below. Tomcat looks for this xml file to get a start of the application.
    7. Update C:\Program Files\Apache...\Tomcat...\webapps\solrTest\collection1\conf\schema.xml and add required fields and update too.
    8. Remove copy fields if not required. Usage of copy fields is available in same file.
    9. Update C:\Program Files\Apache...\Tomcat...\webapps\solrTest\collection1\conf\solrconfig.xml. Update physical index path in tag like ${solr.data.dir:C:/Indexes/solrTest Index/}. If it will be commented then C:\Program Files\Apache...\Tomcat...\webapps\solrTest\collection1\data\ directory will be used by default. DataDir tag is available in file. No need to add your own.
    10. Update replication entries to set either master or slave in replication request handler.
    11. Try accessing “...localhost:portNumber/solrTest”. If no error comes then you have successfully configured SOLR 4.x.

提交回复
热议问题