SOLR and Tomcat Integration

Source: Internet
Author: User

First, preparation: I'm using tomcat7.0,solr-4.8.1.

solr-4.8.1 after decompression is like this.

Two, began to configure the

1, the first to create two folders. Home and server. I was created on the same root directory as solr-4.8.1. D:\work-tool\server\solr\home and D:\work-tool\server\solr\server

2, from solr-4.8.1\dist copy Solr-4.8.1.war to D:\work-tool\server\solr\server decompression. The extracted file is renamed SOLR.

3, from Solr-4.8.1\example\multicore copy all to the previously created folder home, here is the index root data. The file will have the default CORE0, Core1 you can also add your own index, such as copy core1 file to Mycore, open home under the Solr.xml to configure their own index.

<SOLRPersistent= "false">  <!--Adminpath:requesthandler path to manage cores. If ' null ' (or absent), cores'll is not being manageable via request handler -  <coresAdminPath= "/admin/cores"Host= "${host:}"Hostport= "${jetty.port:8983}"Hostcontext= "${HOSTCONTEXT:SOLR}">    <Corename= "Core0"Instancedir= "Core0" />    <Corename= "Core1"Instancedir= "Core1" />    <CoreLoadonstartup= "true"name= "Mycore"Instancedir= "D:\work-tool\server\solr\home\mycore"transient= "false"Collection= "Test"/>    <shardhandlerfactoryname= "Shardhandlerfactory"class= "Httpshardhandlerfactory">      <Strname= "Urlscheme">${urlscheme:}</Str>    </shardhandlerfactory>  </cores>        </SOLR>

4, under Tomcat/conf/catalina/localhost new Solr.xml, if Tomcat conf folder without/catalina/localhost, you can create your own. As follows:

<?XML version= "1.0" encoding= "Utf-8"?><ContextDocBase= "D:\work-tool\server\solr\server\solr-4.8.1.war"reloadable= "true" >      <Environmentname= "Solr/home"type= "Java.lang.String"value= "D:\work-tool\server\solr\home"Override= "true" /></Context>

5. Copy all jars from Solr-4.8.1\example\lib\ext to Tomcat/lib.

6. After completing the above steps, start Tomcat and access http://localhost:8080/solr/admin to confirm the configuration is correct. Go to the bin under the Tomcat directory. Use Startup.bat to start Tomcat.

If you don't want to 8080 the port number and repeat the port number of your previous project.

You can copy a tomcat to a place, and this tomcat is for you to use for SOLR. Then in the Tomcat/conf folder under the Server.xml file, the port number is changed.

Here I change to 8983, access http://localhost:8983/solr/admin on it, verify success.

If you can see the following interface, it means success. After the successful visit in the home folder under the Con0 and Con1 will have a folder data, originally just have conf this folder. Mycore also has more data under its own configuration.

SOLR and Tomcat Integration

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.