我剛開始使用Solr進行遊戲時,我已經部署並運行在Tomcat上。我有架構和數據導入處理程序設置,它索引文件就好了。現在我想安排這個dataImportHandler運行每小時左右。Solr中的DIH調度
有一個wiki頁面詳細說明了文件here。
但也有不允許在創建文件以及如何部署它們
類似的問題已經被問對堆棧溢出here之前的指令。
答案是「創建類ApplicationListener,HTTPPostScheduler和SolrDataImportProperties」。我不知道我應該在哪裏創建課程。但是我猜測,我下載了最新的每晚構建,並在org.apache.solr.handler.dataimport.scheduler包中創建了這些類(從Wiki頁面複製粘貼這些類)。我編譯並運行ant dist命令來創建可部署的jar文件。
我按照wiki中的說明配置dataimport.properties,然後按照上面的答案中的指示將監聽器添加到web.xml文件中。但是當我開始Tomcat solr沒有部署。
我在日誌文件中看到此錯誤消息:
INFO: Starting Servlet Engine: Apache Tomcat/7.0.14
Jun 21, 2011 5:20:47 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor solr.xml from /home/sabman/programs/apache-tomcat-7.0.14/conf/Catalina/localhost
Jun 21, 2011 5:20:47 PM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase /home/sabman/programs/apache-tomcat-7.0.14/webapps/solr.war inside the host appBase has been specified, and will be ignored
Jun 21, 2011 5:20:47 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property.
Jun 21, 2011 5:20:48 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
我不得不從web.xml中刪除監聽器代碼,它的工作,因爲它以前。
有關我可能做錯什麼的想法嗎?
最簡單的解決方案。使用cron條目每小時向'dataimporthandler'發出請求。 – mhitza