我已將solr-4.5.0配置爲使用tomcat7和zookeeper 3.3.5(來自debian包) 根據許多教程我以下Catalina/localhost/solr.xml
文件JNDI中沒有/ solr/home雖然它在Catalina/localhost/solr.xml中設置
<Context allowlinking="true" crosscontext="true" debug="1" docBase="/var/lib/tomcat7/webapps/solr.war" priviledged="true">
<Environment name="solr/home" override="true" type="java.lang.String" value="/opt/solr/webapps/solr1" />
</Context>
我已經在2個機配置Solr的雲工作(使用的動物園管理員,以保持配置)創造了。 在兩臺機器上,開始tomcat7的時候,我看到catalina.out
以下錯誤:
11693 [localhost-startStop-1] INFO org.apache.solr.core.SolrResourceLoader – No /solr/home in JNDI
....
12529 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – Failed to load file /var/lib/tomcat7/solr/collection1/solrconfig.xml
12532 [coreLoadExecutor-3-thread-1] ERROR org.apache.solr.core.CoreContainer – Unable to create core: collection1
org.apache.solr.common.SolrException: Could not load config file /var/lib/tomcat7/solr/collection1/solrconfig.xml
有趣的是,在該文件的beggining我看到:
64 [localhost-startStop-1] INFO org.apache.solr.core.SolrResourceLoader – Using JNDI solr.home: /opt/solr/webapps/solr1
71 [localhost-startStop-1] INFO org.apache.solr.core.SolrResourceLoader – new SolrResourceLoader for directory: '/opt/solr/webapps/solr1/'
當然,我想在JNDI中配置solr/home,而不是在solr.war中。 任何想法可能是錯的?
P.S: 這個問題不是這樣的問題重複: How to set solr/home in linux OS? 這: deploy war in Tomcat 不同的是,我定義的Solr /家,但它似乎沒有工作。
是否有任何機會在同一個tomcat上有兩個不同的solr實例? (例如,webapps/solr.war和webapps/solr1/< - 其中solr1是extracter solr.war)? – rchukh
另外,你可以在'71 [localhost-startStop-1] INFO org.apache.solr.core.SolrResourceLoader - 用於目錄的新SolrResourceLoader:'/ opt/solr/webapps/solr1 /''後面顯示下幾行嗎? – rchukh
還有一件事 - 根據[tomcat 7.0文檔](http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context),一些'Context'參數不應該是完全小寫的(例如allowlinking => allowLinking,crosscontext => crossContext),priviledged有一個錯字(應該有特權),並且沒有調試等選項。 – rchukh