solr6.6定时实时重建索引和增量更新
来源:互联网 发布:易语言电视直播源码 编辑:程序博客网 时间:2024/06/05 02:24
1. 将 apache-solr-dataimportscheduler-1.1.jar 和solr自带的 apache-solr-dataimporthandler-5.1.0.jar, apache-solr-dataimporthandler-extras-5.1.0.jar 放到 tomcat/webapps/solr/WEB-INF/lib/ 目录下面
2.修改tomcat/webapps/solr/WEB-INF/中的web.xml, 在servlet节点前面增加:
3.将apache-solr-dataimportscheduler-1.1.jar 中 dataimport.properties 取出并根据实际情况修改,然后放到 solr_home/conf (不是solr_home/core1/conf) 目录下面,solr_home/conf文件夹没有的话手动创建
4.重启tomcat
dataimport.properties 配置项修改说明:
- #################################################
- # #
- # dataimport scheduler properties #
- # #
- #################################################
- # to sync or not to sync
- # 1 - active; anything else - inactive
- syncEnabled=1
- # which cores to schedule
- # in a multi-core environment you can decide which cores you want syncronized
- # leave empty or comment it out if using single-core deployment
- syncCores=core1
- # solr server name or IP address
- # [defaults to localhost if empty]
- server=localhost
- # solr server port
- # [defaults to 80 if empty]
- port=8080
- # application name/context
- # [defaults to current ServletContextListener's context (app) name]
- webapp=solr
- # URL params [mandatory]
- # remainder of URL
- #增量
- params=/dataimport?command=delta-import&clean=false&commit=true&optimize=false&wt=json&indent=true&entity=students&verbose=false&debug=false
- # schedule interval
- # number of minutes between two runs
- # [defaults to 30 if empty]
- interval=20
- # 重做索引的时间间隔,单位分钟,默认7200,即1天;
- # 为空,为0,或者注释掉:表示永不重做索引
- reBuildIndexInterval=7200
- # 重做索引的参数
- reBuildIndexParams=/dataimport?command=full-import&clean=true&commit=true&optimize=true&wt=json&indent=true&entity=students&verbose=false&debug=false
- # 重做索引时间间隔的计时开始时间,第一次真正执行的时间=reBuildIndexBeginTime+reBuildIndexInterval*60*1000;
- # 两种格式:2012-04-11 03:10:00 或者 03:10:00,后一种会自动补全日期部分为服务启动时的日期
- reBuildIndexBeginTime=09:00:00
为什么会爆这个错,因为SolrDataImportProperties类的loadProperties方法里面:
SolrResourceLoader是solr里面的核心方法,这里传了一个null,但是后面有调用了一个方法,但是我看源码发现没有这个方法,应该是新的版本改了;
上面我做了一点改动,调用无参的构造方法,重新编译打包jar,之后就可以完美运行了;
jar:https://pan.baidu.com/s/1o8jxn8u
源码:https://pan.baidu.com/s/1kUGxnld
- solr6.6定时实时重建索引和增量更新
- solr4.7.1定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新
- solr定时实时重建索引和增量更新——sxt
- 【修改的版本】solr定时实时重建索引和增量更新
- solr6-定时增量索引
- solr6定时增量更新
- solr6.0 -MySQL定时增量、全量更新索引
- sphinx主索引和增量索引实时更新
- solr配置增量更新和定时更新数据库索引
- solrj定时增量更新索引
- solr6.3.0 定时增量更新配置·真
- coreseek实时索引更新之增量索引
- 创建并运行Java运行时代码的三种方式
- 笨办法学 Python · 续 练习 43:SQL 管理
- 回顾Linux、Git 之父Linus Torvalds的传奇技术人生
- python _、__和__xx__的区别
- java中接口的用法
- solr6.6定时实时重建索引和增量更新
- 采用管道函数创建有名管道,使用select函数替代使用poll函数实验多路复用
- Apache POI读合并单元格
- WebView 加载空白问题
- Bluehost服务器虚拟化
- Struts2入门
- Android getDeviceId
- Angularjs-(1)(简介、表达式、指令、控制器、过滤器)
- POMDP详解