solr installation configuration

download:

Download address: http://mirror.bit.edu.cn/apache/lucene/solr/ Select the corresponding version (this time the download is 4.10.4)

Windows download: solr-4.10.4.zip Linux download: solr-4.10.4.tgz

Description of the unzipped directory:

    exapmle

        solr is configured with solr runtime information is a standard solrhome directory.

        webapps-->solr.war

 

Install:

1, install tomcat    

Reference http://wangshirufeng.iteye.com/blog/2242993

2, deploy solr.war to tomcat

Copy the solr.war file in solr-4.10.4\example\webapps to the webapps folder in the tomcat installation directory

Run tomcat. tomcat will automatically extract the solr.war file.

Delete the solr.war file. (Otherwise it will be published every time tomcat is started)

3. Add the extension dependency package to the specified directory

Open the folder: solr-4.10.4/example/lib/ext, copy all jar packages to tomcat's webapps/solr/WEB-INF/lib.

4. Add log4j configuration file

Move the log4j.properties file under solr-4.10.4/example/resource to /webapps/solr/WEB-INF/classes

5. Specify the location of solrhome in web.xml

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

Copy solr-4.10.4\example\solr to the E:/solrhome directory

 

6, SolrCore configuration      

 a, copy the contrib and dist folders below solr-4.10.4 to the E:\solrhome directory

 b, put SolrCore/conf/solrconfig.xml in 

 <lib dir="${solr.install.dir:../../..}/contrib/extraction/lib" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../../..}/dist/" regex="solr-cell-\d.*\.jar" />

 

 <lib dir="${solr.install.dir:../../..}/contrib/clustering/lib/" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../../..}/dist/" regex="solr-clustering-\d.*\.jar" />

 

 <lib dir="${solr.install.dir:../../..}/contrib/langid/lib/" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../../..}/dist/" regex="solr-langid-\d.*\.jar" />

 

 <lib dir="${solr.install.dir:../../..}/contrib/velocity/lib" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../../..}/dist/" regex="solr-velocity-\d.*\.jar" />

改为:

 <lib dir="${solr.install.dir:../..}/contrib/extraction/lib" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../..}/dist/" regex="solr-cell-\d.*\.jar" />

 

 <lib dir="${solr.install.dir:../..}/contrib/clustering/lib/" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../..}/dist/" regex="solr-clustering-\d.*\.jar" />

 

 <lib dir="${solr.install.dir:../..}/contrib/langid/lib/" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../..}/dist/" regex="solr-langid-\d.*\.jar" />

 

 <lib dir="${solr.install.dir:../..}/contrib/velocity/lib" regex=".*\.jar" />

 <lib dir="${solr.install.dir:../..}/dist/" regex="solr-velocity-\d.*\.jar" />

将solr-4.10.4下的contrib和dist文件夹拷贝到E:\solrhome目录下

 

注意: 1,solr.install.dir 路径表示:E:\solrhome\solr\collection1

            2,这步操作不做也不会报错,但是在主界面的日志部分能有找不到资源的日志。 

     

 

启动tomcat后在浏览器地址输入http://localhost:8888/solr/#/ 可以看到SolrHome主页

 

 

配置多个SolrCore:

1,复制collection1 并重命名为 collection2

2,修改 collection2/core.properties 文件内容,将其改为:name=collection2

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326831342&siteId=291194637