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?
- [Root @ svn-server/] # cd/tmp/
- [Root @ svn-server/zookeeper tarzxvfjdk-7u9-linux-x64.tar.gz
- [Root @ svn-server/] # mvjdk1.7.0 _ 09/usr/
- [Root @ svn-server/] # vi/etc/profile
Copy the following code in the last line to add the following content:
[Plain] view plaincopyprint?
- JAVA_HOME =/usr/jdk1.7.0 _ 09/
- CLASSPATH =.: $ JAVA_HOME/lib/tools. jar
- PATH = $ JAVA_HOME/bin: $ PATH
- ExportJAVA_HOMECLASSPATHPATH
Save and exit (: wq !) Run the following command: [plain] view plaincopyprint?
- Source/etc/profile
2. tomcat installation
Decompress the tomcat package to the tmp directory:
[Plain] view plaincopyprint?
- Export root@svn-servertmp1_tarzxvfapache-tomcat-7.0.47.tar.gz
- Move the tomcat package to/usr/local/tomcat:
[Plain] view plaincopyprint?
- [Root @ svn-servertmp] mvapache-tomcat-7.0.47/usr/local/tomcat
Ii. Install solr
1. Decompress solr
[Plain] view plaincopyprint?
- [Root @ svn-servertmp] tar-zxvfsolr-4.7.0.tgz
2. Move the solr package to the opt directory:
[Plain] view plaincopyprint?
- [Root @ svn-servertmp] mv/tmp/solr-4.7.0/opt/solr
3. Copy solr. war in exmaple/webapps to tomcat [plain] view plaincopyprint?
- [Root @ svn-servertmp] makdir-p/opt/tomcat/webapps
- [Root @ svn-servertmp] cp/opt/solr/example/webapps/solr. war/opt/tomcat/webapps/
- [Root @ svn-servertmp] vim/usr/local/tomcat/conf/server. xml
[Plain] view plaincopyprint?
- <Hostname = "localhost" appBase = "/opt/tomcat/webapps"
- 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?
- [Root @ svn-servertmp] cd/usr/local/tomcat/bin/
- [Root @ svn-serverbin]./startup. sh
- [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?
- <Env-entry>
- <Env-entry-name> solr/home </env-entry-name>
- <Env-entry-value>/opt/solr/example/solr </env-entry-value>
- <Env-entry-type> java. lang. String </env-entry-type>
- </Env-entry>
6. Copy the jar package under solr/example/lib/ext to/tomcat/../solr/WEB-INF/lib:
[Html] view plaincopyprint?
- [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?
- [Root @ svn-servertmp] mkdir-p/opt/tomcat/webapps/solr/classpath
- [Root @ svnservertmp] cp/opt/solr/example/resources/log4j. properties/opt/tomcat/webapps/solr/classpath/
8. Restart tomcat after configuration is complete.
[Html] view plaincopyprint?
- /Usr/local/tomcat/bin/shutdown. sh
- /Usr/local/tomcat/bin/startup. sh
The final running result is as follows:
Reprinted please indicate the source: http://blog.csdn.net/fwj380891124/