我已将文件apache-solr-3.5.0.war
放在文件夹C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
中。
自动创建文件夹“apache-solr-3.5.0”。当我去:http://localhost:8080/apache-solr-3.5.0/
。
我可以看到消息“欢迎来到Solr!”。
现在,当我对文件夹solr-4.3.1.war
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps
执行完全相同的操作时
自动创建文件夹solr-4.3.1
。但现在我去的时候:
http://localhost:8080/solr-4.3.1/ OR to http://localhost:8080/solr-4.3.1/admin.html
我看到了错误:
HTTP状态404 - 输入状态报告
消息:说明请求的资源不可用。
Apache Tomcat / 6.0.37
我错过了什么?
更新
这在Tomcat控制台窗口中显示:
INFO: Solr
home set to 'solr/' 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader <init> INFO: Solr home set to
'solr\.\' 12-jul-2013 18:27:36 org.apache.solr.common.SolrException
log SEVERE: java.lang.RuntimeException: Can't find resource
'solrconfig.xml' in class sath or 'solr\.\conf/', cwd=C:\Program
Files\Apache Software Foundation\Tomcat
6.0
at org.apache.solr.core.SolrResourceLoader.openResource(SolrResourceLoad
er.java:268)
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrDispatchFilter init
INFO: user.dir=C:\Program Files\Apache Software Foundation\Tomcat 6.0
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrDispatchFilter init
INFO: SolrDispatchFilter.init() done 12-jul-2013 18:27:36
org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init()
12-jul-2013 18:27:36 org.apache.solr.core.SolrResourceLoader
locateSolrHome INFO: No /solr/home in JNDI 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home
defaulted to 'solr/' (could not find system property or JNDI)
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrServlet init INFO:
SolrServlet.init() done 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: No
/solr/home in JNDI 12-jul-2013 18:27:36
org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: solr home
defaulted to 'solr/' (could not find system property or JNDI)
12-jul-2013 18:27:36 org.apache.solr.servlet.SolrUpdateServlet init
INFO: SolrUpdateServlet.init() done 12-jul-2013 18:27:36
org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web
application archive solr-4.3.1.war 12-jul-2013 18:27:36
org.apache.catalina.core.StandardContext start SEVERE: Error
filterStart 12-jul-2013 18:27:36
org.apache.catalina.core.StandardContext start SEVERE: Context
[/solr-4.3.1] startup failed due to previous errors 12-jul-2013
18:27:36 org.apache.catalina.startup.HostConfig deployDirectory INFO:
Deploying web application directory ROOT 12-jul-2013 18:27:36
org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote
HTTP/1.1 on http-8080 12-jul-2013 18:27:36
org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on
/0.0.0.0:8009 12-jul-2013 18:27:36 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/56 config=null 12-jul-2013 18:27:36
org.apache.catalina.startup.Catalina start INFO: Server startup in 880
ms
我的解压缩的Solr文件夹包含以下文件夹:
css
img
js
META-INF
tpl
WEB-INF
更新
将此添加到我的环境变量后:
JAVA_OPTS = $JAVA_OPTS -Dsolr.solr.home=C:/Databases/solr-4.3.1/example/solr
我在启动后遇到这两个错误:
SEVERE: org.apache.solr.common.SolrException: Invalid luceneMatchVersion 'LUCENE_43', valid values are: [LUCENE_20, LUCENE_21, LUCENE_22, LUCENE_23, LUCENE_24,LUCENE_29, LUCENE_30, LUCENE_31, LUCENE_32, LUCENE_33, LUCENE_34,LUCENE_35, LUCENE_CURRENT] or a string in format 'V.V'
SEVERE: Exception starting filter SolrRequestFilter org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used.
完整日志:
SEVERE: org.apache.solr.common.SolrException: Invalid luceneMatchVersion 'LUCENE _43', valid values are: [LUCENE_20, LUCENE_21, LUCENE_22, LUCENE_23, LUCENE_24, LUCENE_29, LUCENE_30, LUCENE_31, LUCENE_32, LUCENE_33, LUCENE_34, LUCENE_35, LUC ENE_CURRENT] or a string in format 'V.V'
at org.apache.solr.core.Config.parseLuceneVersionString(Config.java:353)
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrDispatchFilter init INFO: user.dir=C:\Program Files\Apache Software Foundation\Tomcat 6.0
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrDispatchFilter init INFO: SolrDispatchFilter.init() done 13-jul-2013 13:46:02 org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init()
13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: No /solr/home in JNDI 13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: using system property solr.solr.home: C:\Databases\solr-4.3.1\exam ple\solr
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrServlet init INFO: SolrServlet.init() done 13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: No /solr/home in JNDI 13-jul-2013 13:46:02 org.apache.solr.core.SolrResourceLoader locateSolrHome INFO: using system property solr.solr.home: C:\Databases\solr-4.3.1\exam ple\solr
13-jul-2013 13:46:02 org.apache.solr.servlet.SolrUpdateServlet init INFO: SolrUpdateServlet.init() done
13-jul-2013 13:46:02 org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive solr-4.3.1.war 13-jul-2013 13:46:03 org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter SolrRequestFilter org.apache.solr.common.SolrException: Could not find necessary SLF4j logging jar s. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext direct ory. For other containers, the corresponding
directory should be used. For more information, see:
http://wiki.apache.org/solr/SolrLogging
更新3
我现在收到“HTTP状态503 - 服务器正在关闭”错误。
14-jul-2013 14:21:57 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: C:\Program
Files\Apache Software Foundation\Tomcat 6.0\bin;C:\Windows\Sun\Java\bin;C:\Windo
ws\system32;C:\Windows;C:\Program Files\Common Files\Microsoft Shared\Windows Li
ve;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\
system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShe
ll\v1.0\;C:\Program Files\TortoiseSVN\bin;c:\msxsl;C:\Program Files (x86)\Window
s Live\Shared;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program File
s (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows
Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110
\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Prog
ram Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQ
L Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL S
erver\110\DTS\Binn\;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files\Java\j
re631\bin;.
14-jul-2013 14:21:57 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
14-jul-2013 14:21:57 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 283 ms
14-jul-2013 14:21:57 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
14-jul-2013 14:21:57 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
14-jul-2013 14:21:57 org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
14-jul-2013 14:21:57 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive solr-4.3.1.war
log4j:WARN No appenders could be found for logger (org.apache.solr.servlet.SolrD
ispatchFilter).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more in
fo.
14-jul-2013 14:21:58 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
14-jul-2013 14:21:58 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
14-jul-2013 14:21:58 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
14-jul-2013 14:21:58 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/55 config=null
14-jul-2013 14:21:58 org.apache.catalina.startup.Catalina start
INFO: Server startup in 719 ms
我在此错误here上阅读了一些内容,但在添加了logging.properties
。
答案 0 :(得分:7)
在不同的论坛上我得到了解决,这是我遵循的步骤:
如果您启动tomcat,您将收到Shawn所提到的错误。 S0你 需要从solr提取的包中复制所有5个jar文件( E:\ solr-4.3.1 \ example \ lib \ ext)到TOMCAT_HOME \ lib目录:
还要复制log4js.properties文件 E:\ solr-4.3.1 \ example \ resources目录到TOMCAT_HOME \ lib目录。
答案 1 :(得分:7)
在Tomcat中安装Solr
预先要求
1 - 使用Windows操作系统的计算机(Windows 7,8,Xp .. ..等)
2 - Java 6或以上
3 - Solr 4.0.0或以上
4 - Apache-tomcat 6或以上。
在Tomcat服务器上获取Solr的步骤
1.在您的计算机上安装Tomcat并确保它已准备好启动。(使用localhost检查:8080)
2.安装Solr4.0发行包apache-solr-4.0.0.zip并将其解压缩到本地目录,如C:\ apache-solr-4.0.0。
3.在本地计算机上创建一个名为solr-home的文件夹,如C:\ solr_home。
4.返回您下载的C:\ apache-solr-4.0.0的solr分发包。在Examples / solr(“C:\ solr-4.4.0 \ example \ solr”)文件夹中查看。将所有这些文件复制到C:\ solr_home文件夹中。(服务器关闭异常将到来)
5.进入C:\ solr-home \ solr,你会看到两个名为collection1和bin的文件夹,将这两个文件夹复制到C:\ solr_home。(如果lib没有复制“严重错误过滤器”)例外来了)
6.将lib从C:\ apache-solr-4.0.0 \ example \ lib \ ext SLF4J和log4j.jar文件复制到Tomcat Lib文件夹C:\ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ lib (https://wiki.apache.org/solr/SolrLogging#Using_the_example_logging_setup_in_containers_other_than_Jetty)
7.将apache-solr-4.0.war(重命名为solr.war)从“C:\ solr-4.4.0 \ dist”目录复制到Tomcat内的webapps目录。(C:\ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ webapps)
8.如果tomact已经启动,那么solr文件夹将创建转到“C:\ Program Files \ Apache Software Foundation \ Tomcat 6.0 \ webapps \ solr \ WEB-INF \ web.xml”编辑web.xml 取消注释和编辑如下(由于init失败,Exception SolrCore'collection1'不可用)
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-value>C:\solr_home\solr</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
9.启动Tomcat并检查localhost:8080 / solr dashBoard将会到来
答案 2 :(得分:1)
根据我的笔记(我前段时间做过那个程序),我不得不在Tomcat“caralina.sh”(或catalina.bat,如果你使用windows)中添加一行:
export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/opt/solr/example/solr"
这用于指定solr“configuration”和“data”目录(存储数据的位置)的位置。在我的情况下,它是“/ opt / solr / example / solr”,但您需要使用系统中具有“配置”文件和“数据”目录的目录。例如,如果在Windows中的C:中解压缩下载的Solr包,则应使用“C:\ solr-4.3.1 \ examples \ solr \”。这意味着,您将在Tomcat中部署“Solr.war”(您已经这样做了),但Solr的配置和存储的“数据”将位于您在catalina.bat中指定的目录中(JAVA_OPS,例如:C: \ solr的-4.3.1 \例子\ SOLR)是
在Windows中的Tomcat中安装Solr的良好说明:http://liuweipingblog.cn/java/install-lucene-solar-with-tomcat-on-windows/
答案 3 :(得分:1)
使用Solr 4.3.0(及更高版本)更新了使用Solr进行日志记录的方式。如果检查Tomcat日志,则很可能会看到“过滤异常”错误。请参阅Solr Logging - Using the example logging setup in containers other than Jetty了解在Tomcat上运行Solr 4.3.0及更高版本所需的步骤。
答案 4 :(得分:1)
由于solr的单独日志记录机制而发生此错误。经过研究我发现,你需要在你的tomcat lib中添加slf4j log jar。 (根据我的本地机器:C:\ xampp \ tomcat \ lib)
从url下载并在tomcat lib中复制jar文件
http://www.slf4j.org/download.html
完成上述步骤后,它在我的本地系统中运行良好。
答案 5 :(得分:0)
有关lucene版本的错误表明您仍在部署3.5版本。我的意思是,我确定你放了4.x战争,但由于某种原因(忘了删除战争,tmp文件)3.5仍然存在。 当您使用系统属性指示solr.home时,它将由您正在部署的“all”solr读取。 所以在你的情况下,4.3.1对给定的solr home(包含LUCENE43)感到高兴,但3.5抛出异常(4.3未知3.5)
答案 6 :(得分:0)
它包含几个步骤
下载solr-XXX.zip并解压缩到solr-XXX。
将solr-XXX.war(从解压缩.zip后的solr-XXX / dist文件夹)复制到Tomcat / webapps中。然后解压缩.war文件(使用WinZip等)。这将创建文件夹solr-XXX。将log4j-XXX.jar,slf4j-api-XXX.jar,slf4j-log4j12-XXX.jar,commons-logging-XXX.jar复制到Tomcat / webapps / solr-XXX / WEB-INF / lib中。并从solr-XXX \ example \ resources
在任何地方创建目录MySolrHome并复制solr-XXX \ example \ solr文件夹的内容
添加JAVA_OPTS = -Dsolr.solr.home = Path / to / MySolrHome /
启动Tomcat