<div id="article_content" class="article_content clearfix csdn-tracking-statistics" data-pid="blog" data-mod="popu_307" data-dsm="post"> <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css"> <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-f57960eb32.css"> <div class="htmledit_views" id="content_views"> <h1 style="font-family:'-apple-system', 'SF UI Text', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, SimHei, SimSun;"><a name="t0"></a>前言:</h1><p style="font-family:'-apple-system', 'SF UI Text', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, SimHei, SimSun;">目前mysql與elasticsearch經常使用的同步機制大可能是基於插件實現的,經常使用的插件包括:elasticsearch-jdbc, elasticsearch-river-MySQL , go-mysql-elasticsearch, logstash-input-jdbc。 <br>本文對四種插件的優缺點進行了圖表對比。</p><h1 style="font-family:'-apple-system', 'SF UI Text', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, SimHei, SimSun;"><a name="t1"></a><a style="color:rgb(12,137,207);" target="_blank"></a>1. 目前業界有如下幾個插件實現ES與Mysql的同步操做。</h1><p style="font-family:'-apple-system', 'SF UI Text', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, SimHei, SimSun;">|序號 | 插件名稱 |地址 | <br>——:———————— :————————————————- <br>| 1 | elasticsearch-jdbc | <a style="color:rgb(12,137,207);" href="https://github.com/jprante/elasticsearch-jdbc" rel="nofollow" target="_blank">https://github.com/jprante/elasticsearch-jdbc</a> | <br>——:———————— :————————————————- <br>| 2 | elasticsearch-river-MySQL | <a style="color:rgb(12,137,207);" href="https://github.com/scharron/elasticsearch-%7Criver-mysql" rel="nofollow" target="_blank">https://github.com/scharron/elasticsearch-|river-mysql</a> | <br>——:———————— :————————————————- <br>| 3 | go-mysql-elasticsearch <br>(國內做者siddontang) <a style="color:rgb(12,137,207);" href="https://github.com/siddontang/go-mysql-%7Celasticsearch" rel="nofollow" target="_blank">https://github.com/siddontang/go-mysql-|elasticsearch</a> | <br>——:———————— :————————————————- <br>| 4 | logstash-input-jdbc <a style="color:rgb(12,137,207);" href="https://github.com/logstash-plugins/logstash-%7Cinput-jdbc" rel="nofollow" target="_blank">https://github.com/logstash-plugins/logstash-|input-jdbc</a> | <br>——:———————— :————————————————- <br>嚴格意義上elasticsearch-jdbc已經不是第三方插件,已經成爲獨立的第三方工具。</p><h1 style="font-family:'-apple-system', 'SF UI Text', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, SimHei, SimSun;"><a name="t2"></a><a style="color:rgb(12,137,207);" target="_blank"></a>二、插件優缺點對比</h1><p style="font-family:'-apple-system', 'SF UI Text', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif, SimHei, SimSun;"><img title="" style="border:none;" alt="這裏寫圖片描述" src="https://img-blog.csdn.net/20160627215020397"></p> </div> </div>css