要求
- 全量数据同步
- 增量实时同步
关注指标
- 数据丢失
- 消息延迟
方案
方案一
使用elasticsearch-jdbc,独立的第三方工具
通过SQL语句进行全量和增量同步
Elasticsearch-JDBC暂时还不支持Elasticsearch 5.0
https://github.com/jprante/elasticsearch-jdbc/issues/915
https://github.com/jprante/elasticsearch-jdbc/tree/master
方案二
logstash-jdbc,logstash官方插件
通过SQL语句进行全量和增量同步
https://www.elastic.co/blog/logstash-jdbc-input-plugin
方案三
go-mysql-elasticsearch第三方开源项目
通过同步Mysql的binlog日志进行增量同步
https://github.com/siddontang/go-mysql-elasticsearch
网友评论