jichenhui2012 2015-12-06 08:28 采纳率: 0%
浏览 3626

Elastic Search 与 mysql数据库实时同步的问题

我知道有一个工具叫ElasticSearch-jdbc,也看了官方文档,根据官方文档写了个测试(命令见最下),但是不能实时同步,它会隔差不多1分钟左右再更新。不知道是什么地方出问题了。还请路过大神不吝赐教!
命令:
{
"type" : "jdbc",
"jdbc" : {
"url" : "jdbc:mysql://xxx.xxx.xxx.xxx:3306/world",
"user" : "root",
"password" : "xxxxxx",
"schedule":"*/5 * * * * ?",
"locale" : "en_US",
"sql" : [
{
"statement":"select \"world\" as _index, \"city\" as _type, ID as _id, Name as \"Name\", CountryCode as \"CountryCode\", District as \"District\", Population as \"Population\" from city where \"mytimestamp\" > ?",
"parameter": [ "$metrics.lastexecutionstart" ]
},
{
"statement" : "delete from city where \"_job\" = ?",
"parameter" : [ "$job" ]
}
],
"statefile":"statefile.json",
"elasticsearch" : {
"cluster" : "my_cluster_name1",
"host" : "localhost",
"port" : 9300
},
"index" : "world",
"type" : "city",
"index_settings" : {
"index" : {
"number_of_shards" : 1
}
}
}
}

  • 写回答

3条回答

  • elasticZhang 2017-02-14 06:21
    关注

    如何解决删除操作不能同步的问题

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划