欢迎投稿

今日深度:

Solr + Tomcat部署,

Solr + Tomcat部署,


Solr + Tomcat部署

1.复制solr.war到tomcat/webapps

solr-4.9.0/example/webapps/solr.war …/apache-tomcat-8.0.9/webapps/

(即solr-4.9.0/dist/solr-4.9.0.war)


 2.修改tomcat/conf/server.xml(此步可忽略)

# vim …/apache-tomcat-8.0.9/conf/server.xml
<Host name="localhost"  appBase="…/apache-tomcat-8.0.9/webapps"
          unpackWARs="true"autoDeploy="true">


3. 重启tomcat,自动生成solr目录,编辑web.xml,

配置solr的服务根目录solr_home,可直接从example/solr这个目录复制过来。

vim …/apache-tomcat-8.0.9/webapps/solr/WEB-INF/web.xml

----------------------------

注意要去掉注释符号

   <env-entry>

      <env-entry-name>solr/home</env-entry-name>

      <env-entry-value>/…/solr/solr-4.9.0/example/solr</env-entry-value>

      <env-entry-type>java.lang.String</env-entry-type>

</env-entry>

----------------------------


4. 复制solr/lib/ext/*.jar

cp solr-4.9.0/example/lib/ext/*.jar …/apache-tomcat-8.0.9/webapps/solr/WEB-INF/lib/

 

5. log4j.properties?

cp example/resources/log4j.properties

/…/tomcat/apache-tomcat-8.0.9/webapps/solr/WEB-INF/lib

/…/tomcat/apache-tomcat-8.0.9/webapps/solr/WEB-INF/classes或(?)

6. 重启tomcat,打开管理界面:

http://10.101.1.xxx:8080/solr


---------------错误处理-----------------------------

HTTP Status 500 - {msg=SolrCore'collection1' is not available due to init failure: Could not load coreconfiguration for core collection1,trace=org.apache.solr.common.SolrException:SolrCore 'collection1' is not available due to init failure: Could not loadcore configuration for core collection1 at 

 

example/solr/README.txt 中有一段话:

If no solr.xml file is found, then Solrassumes that there should bea single SolrCore named "collection1" andthat the "Instance Directory"for collection1 should be the same asthe Solr Home Directory.

如果没有(在solr home目录下面)找到solr.xml, Solr会假定有一个名为"collection1"的Core,并且在Solr home下要有一个collection1的目录。

 

解决方法:

1) 首先可能是由于solr home路径没有配好,Solr找不到solr_home/solr.xml,检查tomcat/webapps/solr/WEB-INF/web.xml中的'solr/home'配置,配置好后需要重启。

2) 如果solr_home目录没有问题,则是由于solr_home目录下面没有solr.xml这个文件,这种情况可拷贝example/example-schemaless/solr/目录下的solr.xml或collection1到solr home下面。

-------------------------------------------------

www.htsjk.Com true http://www.htsjk.com/solr/38381.html NewsArticle Solr + Tomcat部署, Solr + Tomcat部署 1.复制solr.war到tomcat/webapps solr-4.9.0/example/webapps/solr.war …/apache-tomcat-8.0.9/webapps/ (即solr-4.9.0/dist/solr-4.9.0.war)  2.修改tomcat/conf/server.xml(此步可忽略) # vi...
相关文章
    暂无相关文章
评论暂时关闭