Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Rapid implementation of Solr

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

In some projects, in order to improve the efficiency of search, we generally use external tools, such as ES, SOLR and so on, to realize the fast reflection of business ambiguity and other search. For a brief description of how to combine operations such as MySQL, please see the network-related documentation.

Initial presentation:

Add a CORE:

With a simple query

Environmental preparation

System environment:

CENTOS

TOMCAT

Jdk

Solr4.9

1. JDK installation strategy

2. Tomcat installation (download TOMCAT without the latest, there may be unexpected problems)

Tar-zxvf apache-tomcat-7.0.82.tar.gz-C / usr/local

Mv apache-tomcat-7.0.82 tomcat

3. Decompress solr (package download: http://archive.apache.org/dist/lucene/solr/4.9.0/)

Tar-zxvf solr-4.9.0.tgz-C / usr/local

Mv solr-4.9.0 solr

4. Create a site directory for solr

Makdir-p / opt/tomcat/webapps

Cp / usr/local/solr/example/webapps / opt/tomcat/webapps

5. Modify the site path of tomcat's solr

Vim / usr/local/tomcat/conf/server.xml

6. After starting tomcat, you can find many files on the site (/ opt/tomcat/webapps) and modify the web.xml under the solr project.

Vi/opt/tomcat/webapps/solr/WEB-INF/web.xml

Modify solrhome configuration (Note: uncomment this paragraph, otherwise it will not take effect):

Solr/home

/ opt/solr/example/solr

Java.lang.String

7. Copy the jar package under / usr/local/solr/example/lib/ext to / opt/tomcat/webapps/solr/WEB-INF/lib/:

Cp / usr/local/solr/example/lib/ext/*.jar / opt/tomcat/webapps/solr/WEB-INF/lib/

8. Create classpath under / opt/tomcat/webapps/solr and copy / usr/local/solr/example/resources/log4j.properties to classpath

Mkdir-p / opt/tomcat/webapps/solr/classpath

Cp / usr/local/solr/example/resources/log4j.properties / opt/tomcat/webapps/solr/classpath/

9. Restart tomcat after configuration

/ usr/local/tomcat/bin/shutdown.sh

/ usr/local/tomcat/bin/startup.sh

10. Add a new Core, (/ opt/solr/example/solr) add a new directory under the data directory, and then copy several files from the original package to the new directory

Cp / usr/local/solr/example/exampledocs/post.jar. / mydocs/

Cp / usr/local/solr/example/exampledocs/ipod_other.xml. / mydocs/

Cp-r / usr/local/solr/example/multicore/core0/conf. / mydocs/

This is the end of the building part, pay attention to the path of your own package during the installation and configuration

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report