Configuration of SOLR on Tomcat and debugging in eclipse

Source: Internet
Author: User
Tags solr

Download SOLR, tomcat, and ant from the Apache website. After SOLR is compiled with ant, * SOLR *. War is generated in the DIST directory of SOLR. You can copy the war to Tomcat webapp. You can also specify the location of the war and SOLR/home by using JNDI. Because SOLR will follow $ cmd (the directory where Tomcat is running) and SOLR/home to find the configuration file required by SOLR (schema. XML solrconfig. XML) and the storage of the last index are based on SOLR/home.

The SOLR/home method specified by JNDI is to create a SOLR. xml file under the Apache Software Foundation/tomcat 6.0/CONF/Catalina/localhost directory. The content is:

<Context docbase = "D:/temp/jaagle/apache-solr-1.3.0/Dist/SOLR. War" DEBUG = "0" crosscontext = "true">
<Environment name = "SOLR/home" type = "Java. Lang. String" value = "D:/temp/jaagle/SOLR" override = "true"/>
</Context>

Or you can directly specify the SOLR home path in Web. xml.

<Env-entry>
<Env-entry-Name> SOLR/home </env-entry-Name>
<Env-entry-value>/Put/Your/SOLR/home/here </env-entry-value>
<Env-entry-type> JAVA. Lang. String </env-entry-type>
</Env-entry>

We can clearly see the location of the war and the location of the configuration file. The SOLR configuration file is under example/SOLR, and copy the content under this directory to the specified directory.

Another way to specify SOLR/home is to add-dsolr. SOLR. Home = D:/temp/jaagle/SOLR to the parameter before starting tomcat. This is a static deployment method. You can dynamically load war files and enter the Tomcat Management page through http: // localhost: 8080/manager/html. However, the webapp loaded through the Management page will not be automatically mixed during the next Tomcat startup.

For our developers, it is best to debug SOLR code in eclipse. This problem can be solved by downloading eclipse Tomcat plugin. Currently, many plug-ins are used for sysdeo. You can download them at http://www.eclipsetotale.com/atatplugin.html. Decompress the package and add it to the plugin of Eclipse/plugins. After startup, you can see that this button is added to the toolbar. The kittens start, stop, and restart Tomcat from left to right.

Be sure to select JRE in JDK, otherwise sysde will not run!

Select Server. XML in context declaration mode

Http://wiki.apache.org/solr/SolrTomcat
Http: // localhost: 8080/manager/html/reload? Path =/SOLR

Http://www-128.ibm.com/developerworks/cn/opensource/os-ectom/

 

Related Article

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.