SOLR 4 Examples of deployment tutorials
SOLR 4.0 Introductory Basic tutorial, first say a bit after deployment will certainly be someone with SOLRJ,SOLR 4.0 seems to add a lot of things, which commonshttpsolrserver this class renamed Httpsolrserver, I was looking for a long while to find that Everyone can pay attention later.
Prepare before deployment:
- SOLR must be running in Java1.5 or later Java virtual machines, and running the standard SOLR service requires only installing the JRE.
- SOLR 4.0:http://www.apache.org/dyn/closer.cgi/lucene/solr/4.0.0
- This article is a demonstration of Tomcat7.0.
SOLR 4.0 directory:
Here is how I deploy, Tomcat installs the Solr.war file under Apache-solr-4.0.0\example\webapps to the Tomcat7.0\webapps directory under Tomcat, and then launches Tomcat Error no tube, Solr.war will automatically unzip, then open Tomcat7.0\webapps\solr\web-inf\web.xml, copy the following code to put in the back:
<Env-entry> <Env-entry-name>Solr/home</Env-entry-name> <Env-entry-value>E:\SolrHome</Env-entry-value> <Env-entry-type>Java.lang.String</Env-entry-type></Env-entry>
Where E:\SolrHome is to store SOLR configuration files and so on, modify the location of their files, in order to see more clearly and intuitively, you can put:
E:\Tomcat7.0
E:\apache-solr-4.0.0
E:\SolrHome
Now you can restart Tomcat, no error, enter the Solr4.0 page via this address: HTTP://LOCALHOST:8080/SOLR
If the above interface is successful, there will be an error message on the page without success.
The left Core0,core1 is the example in SOLR 4.0, where Core0 and Core1 are located under Apache-solr-4.0.0\example\multicore All files are copied under E:\SoleHome, Core0 and Core1 can be understood as two libraries, are independent, used to store the index and generate these index files required by the configuration file, Solrtest is my test set up the directory,
Not adding a library needs to be configured in Solr.xml, which is relatively simple
<SOLRPersistent= "false"> <coresAdminPath= "/admin/cores"Host= "${host:}"Hostport= "${jetty.port:}"> <Corename= "Core0"Instancedir= "Core0" /> <Corename= "Core1"Instancedir= "Core1" /> <Corename= "Collection1"Instancedir= "Collection1" /> <Corename= "Solrtest"Instancedir= "Solrtest"/> </cores></SOLR>
Name= "", is the name of the library, instancedir= "", is the directory
SOLR 4 Examples of deployment tutorials