速點鏈接加入高手戰隊:http://www.dajiangtai.com/course/112.do
注:Canal必備基礎及安裝部署,詳看完整文檔,以下直接摘取乾貨分享。
實現MySQL-->Canal-Server(Instance)--->ClientAdapter--->ES同步流程
所涉及組件的關係(如下)
相關組件的作用
準備業務庫表
在MySQL中創建test庫及test表作爲業務庫表,我們最終就是要同步test.test表的數據到ES:
執行如下MySQL命令:
配置Instance
前面安裝了Canal_Server,接下來需要給Canal_Server創建Instance來拉取MySQL的binlog。
1、登錄Canal_Admin
2、進入Instance管理頁
3、新建Instance
點擊新建Instance就會進入新建Instance配置頁面:
4、載入Instance模板
Instance配置不需要從零開始寫,先載入模板即可,如下圖:
5、配置Instance
6、Instance命名
7、保存Instance
保存之後,就自動顯示在Instance列表頁了:
8、自動啓動Instance
刷新Instance列表頁,過一會就已經變成啓動狀態了:
至此,MySQL的binlog數據就可以被Canal-Server拉取到了。