SOLR installation (1)

Source: Internet
Author: User
SOLR is an enterprise-level Search Server Based on the Lucene Java library. This article records the installation process of SOLR with the latest version 1.4.1. 1) download the latest version 1.4.1 from the SOLR official website http://developere.apache.org/solr. open the downloaded apache-solr-1.4.1.zip or apache-solr-1.4.1.tgz file to the apache-solr-1.4.1 directory. 2) The release package for simple installation of SOLR contains some example. To facilitate the running of these example, jetty is included in the SOLR release package so that we can quickly build a runable SOLR instance. Because everything is ready-made, so the process is very simple, refer to the SOLR tutorial (http://lucene.apache.org/solr/tutorial.html), the steps are as follows: 1. CD apache-solr-1.4.1/Example 2. Java-jar start. Jar 3. Open your browser and Access access http: // localhost: 8983/SOLR/admin/. If you can see the SOLR search page, it indicates that SOLR is running properly. Easy enough. -- Here is only the simplest SOLR installation. First, try it. 3) The simple installation method above standard installation cannot be used in formal occasions after all. Therefore, standard installation is required. There are not many things to be done to install SOLR, because it only needs to run a packaged war package. As long as the configuration is OK, it can run on various Web container. The general steps for installing SOLR are as follows: 1. Prepare Web Container such as Tomcat, Jetty, and resin. -- Tomcat is used here. Stop the Web iner server before installation. 2. Find the example \ SOLR directory from the SOLR release package decompressed above. This directory can be used as a SOLR configuration template. Copy the example \ SOLR directory to another path, such as c: \ soft \ SOLR. This directory will be used as SOLR home. Note that you need to modify a file, $ solr_home/CONF/solrconfig. XML, and find the datadir settings: The default value is <datadir >$ {SOLR. Data. dir:./SOLR} </datadir>. The relative path is used, which must be changed to the complete path: <Datadir >$ {SOLR. Data. dir: C: \ soft \ SOLR \ data} </datadir> 3. Find the SOLR war package from the SOLR release package decompressed above. 1) apache-solr-1.4.1/Dist/apache-solr-1.4.1.war (Note: The war read path here) You can copy this war to the SOLR home directory. 4. Start Web Container There are two things to do at startup: 4.1. SOLR webapp to run You can directly copy the SOLR war package to the webapp directory, or specify the path of the war in other ways. In short, let the Web Container start the SOLR application. 4.2. Specify SOLR home (for specific operation methods, see section 4 below) There are three methods: 1. Set the java system parameter SOLR. SOLR. Home (it should be SOLR. Home, but the official website is SOLR. SOLR. Home) For example,-dsolr. SOLR. Home = c: \ soft \ SOLR 2. Set JNDI lookup "Java: COMP/ENV/SOLR/home" 3. The default value is the./SOLR directory, that is, SOLR under the current working path. This method is generally not recommended because the working path is prone to problems. 5. Visit the SOLR Management page to verify whether the installation is complete. The other steps in the above steps are simple. Only Step 4 requires additional attention. Although in principle, different Web iner methods are used. Take Tomcat and jetty as an example. Assume that steps 1, 2, and 3 have been completed. 4) installed in Tomcat the following content refer to the official website documentation http://wiki.apache.org/solr/SolrTomcat. 1. Modify the Tomcat server. xml file It is mainly to modify the listening port, and you need to set uriencoding to UTF-8. <Connector Port =" 8983 "Protocol =" HTTP/1.1 "connectiontimeout =" 20000 "redirectport =" 8443" Uriencoding = "UTF-8" /> (Note: here must be specified is the UTF-8 format, otherwise the Chinese word segmentation will appear garbled) 2. Added Tomcat \ conf \ Catalina \ localhost \ SOLR. xml file Content: <? XML version = "1.0" encoding = "UTF-8"?> <Context docbase = "C: \ soft \ SOLR \ apache-solr-1.4.1.war" DEBUG = "0" crosscontext = "true"> <environment name = "SOLR/home" type = "Java. lang. string "value =" C: \ soft \ SOLR "override =" true "/> </context> Step 4 is complete. The tomcat version used is 6.28. Modify the corresponding $ solr_home path.

After the installation is complete, you can access it through http: // localhost: 8983/SOLR/admin.

5) installed on Jetty (not tested in italic text below)
The following content refer to the official website documentation http://wiki.apache.org/solr/SolrJetty, but frankly speaking, the content of this document is a bit messy.
After Jetty is installed, add the jetty \ contexts \ SOLR. xml file in one step. The content is as follows:

<? XML version = "1.0" encoding = "ISO-8859-1"?> <! Doctype configure public "-// Mort Bay consulting // DTD configure //" http://jetty.mortbay.org/configure.dtd ">
<Configure class = "org. mortbay. Jetty. webapp. webappcontext"> <Set name = "contextpath">/SOLR </set> <Set name = "war"> C: \ soft \ SOLR \ apache-solr-1.4.1.war </set>
<Set name = "extractwar"> true </set> <Set name = "copywebdir"> false </set> <Set name = "defaultsdescriptor"> <systemproperty name = "Jetty. Home" default = "."/>/etc/webdefault. xml </set>
<Array id = "plusconfig" type = "Java. Lang. String"> <Item> org. mortbay. Jetty. webapp. webinfconfiguration </item> <Item> org. mortbay. Jetty. Plus. webapp. envconfiguration </item> <Item> org. mortbay. Jetty. Plus. webapp. Configuration </item> <Item> org. mortbay. Jetty. webapp. jettywebxmlconfiguration </item> <Item> org. mortbay. Jetty. webapp. taglibconfiguration </item> </Array>
<Set name = "configurationclasses"> <ref id = "plusconfig"/> </set>
<New class = "org. mortbay. Jetty. Plus. Naming. enventry"> <Arg>/SOLR/home </Arg> <Arg type = "Java. Lang. String"> C: \ soft \ SOLR </Arg> <Arg type = "Java. Lang. boolean"> true </Arg> </New>
</Configure>
Specify the contextpath/war and set "/SOLR/home". Note that Jetty is "/SOLR/Home", not "SOLR/home ". This is a bit strange.
Limited time, other webcontainer will not be tested one by one, and I believe the principles are the same.

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.