Solr中的DIH计划 [英] DIH Scheduling in Solr

查看:94
本文介绍了Solr中的DIH计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Solr,已经将它部署并在Tomcat上运行.我已经设置了架构和数据导入处理程序,它对文件进行了索引.现在,我想安排此dataImportHandler每小时运行一次.

I have just started playing around with Solr and I have it deployed and running on Tomcat. I have the schema and data import handler set up and it indexes the files just fine. Now I want to schedule this dataImportHandler to run every hour or so.

有一个Wiki页面,详细介绍了文件此处.

There is a wiki page detailing the files here.

但是没有关于在何处创建文件以及如何部署文件的说明

But there are not instructions on where to create the files and how to deploy them

这里.

答案是创建类ApplicationListener,HTTPPostScheduler和SolrDataImportProperties".我不知道我应该在哪里创建课程.但是我猜了一下,我下载了最新的每晚版本,并在org.apache.solr.handler.dataimport.scheduler包中创建了这些类(从Wiki页面粘贴这些类).我编译并运行了ant dist命令来创建可部署的jar文件.

The answer was to "Create classes ApplicationListener, HTTPPostScheduler and SolrDataImportProperties". I don't know where I should be creating the classes. But I took a guess and I downloaded the latest nightly build and created the classes in the org.apache.solr.handler.dataimport.scheduler package (copy pasting the classes from the wiki page). I compiled and ran the ant dist command to create the deployable jar files.

我按照Wiki中的说明配置了dataimport.properties,然后按照上述答案中的说明将侦听器添加到web.xml文件中.但是,当我启动Tomcat时,solr尚未部署.

I configured the dataimport.properties as per the instructions in the wiki and then added the listener in the web.xml file as instructed in the answer above. But when I started Tomcat solr was not deployed.

我在日志文件中看到此错误消息:

I see this error message in the log file:

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中删除侦听器代码,以使其像以前一样工作.

I had to remove listener code from the web.xml for it work as it was before.

关于我可能在做错什么的任何想法吗?

Any idea about what I could be doing wrong?

推荐答案

我从Solr邮件列表中得到了以下答复:

I got this reply from the Solr mailing list:

Wiki页面描述了一个计划程序的设计,该计划尚未提交给Solr(我检查过).我前几天确实看到了补丁(请参见 https://issues.apache.org/jira /browse/SOLR-2305 ),但它并未经过良好测试.

The Wiki page describes a design for a scheduler, which has not been committed to Solr yet (I checked). I did see a patch the other day (see https://issues.apache.org/jira/browse/SOLR-2305) but it didn't look well tested.

我认为您现在基本上已经停滞了cron之类的东西.如果您的应用程序是用Java编写的,请查看Quartz调度程序- http://www.quartz-scheduler. org/

I think that you're basically stuck with something like cron at this time. If your application is written in java, take a look at the Quartz scheduler - http://www.quartz-scheduler.org/

这篇关于Solr中的DIH计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆