我一直在尝试在我的家庭电脑上安装Solr 4.3(在Tomcat 7中),但是没有运行。我已经设置了Tomcat并部署了解压缩文件,这两个文件都解压缩并显示在Tomcat的Tomcat Web Apps Manager屏幕中,但它没有运行,并且单击开始按钮不会执行任何操作(因为它应该已经在第一名)。
这是Tomcat中的solr.xml上下文文件,它也给出了solr.war文件的路径,我的solr核心是哪个(默认的Collection1):
<Context path="/solr" docBase="C:/LocalApps/Tomcat/apache-tomcat-7.0.40/webapps/solr.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="C:/LocalApps/Solr/solr-4.3.0/example/solr/" override="true"/> </Context>
这是tomcat中的错误日志:
INFO: Starting Servlet Engine: Apache Tomcat/7.0.40 Jun 09,2013 11:04:07 PM org.apache.catalina.startup.HostConfig deployDescriptor INFO: Deploying configuration descriptor C:\LocalApps\Tomcat\apache-tomcat-7.0.40\conf\Catalina\localhost\solr.xml Jun 09,2013 11:04:07 PM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase C:\LocalApps\Tomcat\apache-tomcat-7.0.40\webapps\solr.war inside the host appBase has been specified,and will be ignored Jun 09,2013 11:04:07 PM org.apache.catalina.startup.SetContextPropertiesRule begin WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property. Jun 09,2013 11:04:09 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Error filterStart Jun 09,2013 11:04:09 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/solr] startup Failed due to prevIoUs errors
您需要安装用于日志记录的jar,如
here所述。
将所有提到的文件复制到您的tomcat / lib目录中。并重新启动Tomcat。
- Copy the jars from
solr/example/lib/ext
into your container’s main lib directory. These jars will set upSLF4J
andlog4j
.
Exactly where this lib directory is highly variable. For a Debian or
Ubuntu server using the Tomcat package available from the OS vendor,
this is likely to be/usr/share/tomcat6/lib
or
/usr/share/tomcat7/lib
.- Copy the logging config from
solr/example/resources/log4j.properties
into a location on the
classpath
. Usually you can use the same location as the jar files
above. Edit the configuration file for your preferred log destination.- Optionally,if you did not place log4j.properties on the classpath,set
java option -Dlog4j.configuration=file:///path/to/log4j.properties