如何在 Linux 操作系统中设置 solr/home? [英] How to set solr/home in linux OS?
问题描述
我知道如何使用Tomcat 6配置solr.home
,但不知道如何使用Glassfish(V2.1)设置solr.home
.我试图将 .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 配置错误后继续,更改:假为空------------------------------------------------------------- java.lang.RuntimeException: 在中找不到资源solrconfig.xml"类路径或solr/conf/",cwd=/home/huenzhao/search/glassfish/domains/domain1/config atorg.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoader.java:194)在org.apache.solr.core.SolrResourceLoader.openConfig(SolrResourceLoader.java:162)在 org.apache.solr.core.Config.(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)在com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)在com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)在com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:1005)在
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 作为容器运行,您可以在此 Web 应用程序的 XML 描述符中指定 solr home.(我的术语可能有点偏差).
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 片段,它们在 xml 片段中指定了自己的本地 solr 主目录.这些片段位于/conf/Catalina/localhost 并且每个片段都管理一个 solr 实例.这样我就可以在同一台机器上有多个 solr 实例,每个实例都有自己的 solr home 变量.
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上下文片段来将 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:
符号链接或将文件放在$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 操作系统中设置 solr/home?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!