Deploy Solr search engine under CentOS7.0

Source: Internet
Author: User
Tags solr

Deploy Solr search engine under CentOS7.0

I. Environment preparation:

System Environment: CentOS-7.0.1406
Tomcat-7.0.29

Jdk-7u9

Solr-4.7.0

First, upload the package to the/tmp directory.
1. jdk Installation

[Plain] view plaincopyprint?
  1. [Root @ svn-server/] # cd/tmp/
  2. [Root @ svn-server/zookeeper tarzxvfjdk-7u9-linux-x64.tar.gz
  3. [Root @ svn-server/] # mvjdk1.7.0 _ 09/usr/
  4. [Root @ svn-server/] # vi/etc/profile
Copy the following code in the last line to add the following content:
[Plain] view plaincopyprint?
  1. JAVA_HOME =/usr/jdk1.7.0 _ 09/
  2. CLASSPATH =.: $ JAVA_HOME/lib/tools. jar
  3. PATH = $ JAVA_HOME/bin: $ PATH
  4. ExportJAVA_HOMECLASSPATHPATH
Save and exit (: wq !) Run the following command: [plain] view plaincopyprint?
  1. Source/etc/profile

2. tomcat installation
Decompress the tomcat package to the tmp directory:

[Plain] view plaincopyprint?
  1. Export root@svn-servertmp1_tarzxvfapache-tomcat-7.0.47.tar.gz
  2. Move the tomcat package to/usr/local/tomcat:
[Plain] view plaincopyprint?
  1. [Root @ svn-servertmp] mvapache-tomcat-7.0.47/usr/local/tomcat

Ii. Install solr
1. Decompress solr

[Plain] view plaincopyprint?
  1. [Root @ svn-servertmp] tar-zxvfsolr-4.7.0.tgz
2. Move the solr package to the opt directory:
[Plain] view plaincopyprint?
  1. [Root @ svn-servertmp] mv/tmp/solr-4.7.0/opt/solr

3. Copy solr. war in exmaple/webapps to tomcat [plain] view plaincopyprint?
  1. [Root @ svn-servertmp] makdir-p/opt/tomcat/webapps
  2. [Root @ svn-servertmp] cp/opt/solr/example/webapps/solr. war/opt/tomcat/webapps/
  3. [Root @ svn-servertmp] vim/usr/local/tomcat/conf/server. xml
[Plain] view plaincopyprint?
  1. <Hostname = "localhost" appBase = "/opt/tomcat/webapps"
  2. UnpackWARs = "true" autoDeploy = "true">

Change webapps to/opt/tomcat/webapps;

4. Start tomcat, automatically decompress solr. war, and modify web. xml under the solr project.

[Plain] view plaincopyprint?
  1. [Root @ svn-servertmp] cd/usr/local/tomcat/bin/
  2. [Root @ svn-serverbin]./startup. sh
  3. [Root @ svn-serverbin] vi/opt/tomcat/webapps/solr/WEB-INF/web. xml

5. Modify the solr home configuration (Note: You need to remove the comments of this Section, otherwise it will not take effect ):

[Html] view plaincopyprint?
  1. <Env-entry>
  2. <Env-entry-name> solr/home </env-entry-name>
  3. <Env-entry-value>/opt/solr/example/solr </env-entry-value>
  4. <Env-entry-type> java. lang. String </env-entry-type>
  5. </Env-entry>

6. Copy the jar package under solr/example/lib/ext to/tomcat/../solr/WEB-INF/lib:

[Html] view plaincopyprint?
  1. [Root @ svn-servertmp] cp/opt/solr/example/lib/ext/*. jar/opt/tomcat/webapps/solr/WEB-INF/lib/

7. Create classpath under tomcat solr and copy example/resources/log4j. properties to classpath:

[Html] view plaincopyprint?
  1. [Root @ svn-servertmp] mkdir-p/opt/tomcat/webapps/solr/classpath
  2. [Root @ svnservertmp] cp/opt/solr/example/resources/log4j. properties/opt/tomcat/webapps/solr/classpath/

8. Restart tomcat after configuration is complete.

[Html] view plaincopyprint?
  1. /Usr/local/tomcat/bin/shutdown. sh
  2. /Usr/local/tomcat/bin/startup. sh


The final running result is as follows:


Reprinted please indicate the source: http://blog.csdn.net/fwj380891124/

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.