Tutorial on deploying solr server on this machine

The basic steps for deploying the solr server on this machine are as follows:
1. Download solr from the website: http://mirror.bit.edu.cn/apache/lucene/solr/6.6.0/ , and extract it to a local folder
2. Download tomcat, URL: http://tomcat.apache.org/ , and extract it to a local folder, E:\packs\run\tomcat8.0-solr6
3. Put solr-6.6.0\server\solr-webapp\ under the folder Copy the webapp folder of Tomcat to the Tomcat\webapps\ directory and change it to solr (the name is optional, it will be used when accessing the solr management interface through a browser)
4. Put the solr compressed package in solr-6.6.0\server\ Copy all jars in lib\ext to Tomcat\ webapps\solr\WEB-INF\lib directory
5. Copy solr-6.6.0\server\resources\log4j.properties in the solr compressed package to Tomcat\ webapps\solr
6. Copy the solr directory in solr-6.6.0/server/ in the solr compressed package to a directory on the computer, such as E:\packs\run\solr, and change the name to solr_home;
7. Open web.xml under Tomcat/webapps/solr/WEB-INF, find the following configuration content (the content is commented out in the initial state), and modify the content to your solr_home path:

<env-entry>
       <env-entry-name>solr/home</env-entry-name>
       <env-entry-value>E:\packs\run\solr\solr_home</env-entry-value>
       <env-entry-type>java.lang.String</env-entry-type>
</env-entry>


8. Save and close, then start tomcat, enter http://localhost:8080/solr/index.html in the browser, and the Solr management interface will appear


Note:
Part 7 also supports, directly prevent the path in the tomcat server, For example, you can put the entire solr_home folder under webapps/solr/ of tomcat, and then modify the configuration file in web.xml to: /webapps/mysolr/solr_home


How to use it on the java side after it is deployed locally?
It is necessary to introduce solrrj related packages, the official website explains: solr-solrj: Solrj - Solr Java Client


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326422233&siteId=291194637