如何在Linux OS中设置solr / home? [英] How to set solr/home in linux OS?

查看:381
本文介绍了如何在Linux OS中设置solr / home?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用Tomcat 6配置 solr.home ,但是我不知道如何设置 solr.home 通过使用Glassfish(V2.1)。我试图将 .profile 中的 solr.home 设置为同伴:

I know how to configure solr.home by using Tomcat 6, but I don't know how to set solr.home by using Glassfish(V2.1). I have tried to set the solr.home in .profile as fellows:

export solr.home=/home/huenzhao/search/solr
export solr/home=/home/huenzhao/search/solr
export solr.solr.home=/home/huenzhao/search/solr
export JAVA_OPTS=$JAVA_OPTS -Dsolr.solr.home=/home/huenzhao/search/solr

并且它们都不起作用。错误是:

and they all not work. The error is:


HTTP状态500-Solr配置中的严重错误。检查您的日志
文件,以获取有关可能出错的更多详细信息。如果您希望
solr在配置错误后继续运行,请更改:
false in null
----------------------- -------------------------------------- java.lang.RuntimeException:找不到资源'
类路径中的solrconfig.xml或'solr / conf /',
cwd = / home / huenzhao / search / glassfish / domains / domain1 / config在
org.apache.solr.core中.SolrResourceLoader.openResource(SolrResourceLoader.java:194)

org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:162)
在org.apache.solr.core配置文件(Config.java:100)在
org.apache.solr.core.SolrConfig。(SolrConfig.java:113)在
org.apache.solr.core.SolrConfig。(SolrConfig。 java:70)在
org.apache.solr.core.CoreContainer $ Initializer.initialize(CoreContainer.java:117)

org.apache.solr.servlet.SolrDispatchFilter.init( SolrDispatchFilter.java:69)

org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:273)

org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:385)

org.apache.catalina.core.ApplicationFilterConfig。(ApplicationFilterConfig.java:119) org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4498)中的
org.apache.catalina.core.StandardContext.start(StandardContext。 java:5317)com.sun.enterprise.web.WebModule.start(WebModule.java:353)处的
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:989) org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:973)的
org.apache.catalina.core.StandardHost.addChild(StandardHost。 java:704)在
处的
com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1627)在
处的
com.sun.enterprise.web.WebContainer。 loadWebModule(WebContainer.java:1232)
at
com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeploy ed(WebModuleDeployEventListener.java:182)

com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)

com.sun.enterprise。 admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:1005)
at

HTTP Status 500 - Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: false in null ------------------------------------------------------------- java.lang.RuntimeException: Can't find resource 'solrconfig.xml' in classpath or 'solr/conf/', cwd=/home/huenzhao/search/glassfish/domains/domain1/config at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:194) at org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:162) at org.apache.solr.core.Config.(Config.java:100) at org.apache.solr.core.SolrConfig.(SolrConfig.java:113) at org.apache.solr.core.SolrConfig.(SolrConfig.java:70) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:117) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:69) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:273) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:385) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:119) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4498) at org.apache.catalina.core.StandardContext.start(StandardContext.java:5317) at com.sun.enterprise.web.WebModule.start(WebModule.java:353) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:989) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:973) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:704) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1627) at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1232) at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182) at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278) at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:1005) at

……

有人知道吗?

推荐答案

如果要在tomcat中运行solr作为容器,则可以在此Webapp的XML描述符中指定solr主页。 (我的术语可能有点过头。)

if you are running solr inside tomcat as a container you can specify the solr home inside the XML descriptor for this webapp. (my terminology for this is probably a little off).

我为要运行的每个Solr实例都有xml片段,它们指定了自己的本地solr主目录xml片段中。这些片段位于/ conf / Catalina / localhost,每个片段管理一个solr实例。这样,我可以在同一台计算机上有多个solr实例,每个实例都有自己的solr主变量。

I've got xml fragments for each solr instance I want to run and they specify their own local solr home directory inside the xml fragment. The fragments live at /conf/Catalina/localhost and each one manages a solr instance. This way I can have multiple solr instances on the same machine each with their own solr home variable.

信息在这里:
http://wiki.apache.org/solr/SolrTomcat

在特定情况下


创建一个Tomcat Context片段到
,将docBase指向
$ SOLR_HOME / apache-solr- 1.3.0.war文件
和solr / home到$ SOLR_HOME:

Create a Tomcat Context fragment to point docBase to the $SOLR_HOME/apache-solr-1.3.0.war file and solr/home to $SOLR_HOME:




Symlink
或将文件放置在
$ CATALINA_HOME / conf / Catalina / localhost / solr-example.xml,
中,Tomcat将在其中自动选择
。 Tomcat会删除
取消部署的文件(如果配置无效,则会自动删除
)。


Symlink or place the file in $CATALINA_HOME/conf/Catalina/localhost/solr-example.xml, where Tomcat will automatically pick it up. Tomcat deletes the file on undeploy (which happens automatically if the configuration is invalid).

这篇关于如何在Linux OS中设置solr / home?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆