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