DataX
1.簡(jiǎn)介
DataX 是阿里云DataWorks數(shù)據(jù)集成的開源版本,在阿里巴巴集團(tuán)內(nèi)被廣泛使用的離線數(shù)據(jù)同步工具/平臺(tái)。DataX 實(shí)現(xiàn)了包括 MySQL、Oracle、OceanBase、SqlServer、Postgre、HDFS、Hive、ADS、HBase、TableStore(OTS)、MaxCompute(ODPS)、Hologres、DRDS, databend 等各種異構(gòu)數(shù)據(jù)源之間高效的數(shù)據(jù)同步功能。
2.工具安裝部署
2.1.安裝 jdk1.8
請(qǐng)參考相關(guān) JDK 1.8 的安裝配置教程,此處略。
2.2. 安裝 python 2.x
請(qǐng)參考相關(guān) Python 2.x 安裝配置教程,此處略。
2.3.安裝 DataX
步驟1:下載DataX
下載地址:http://datax-opensource.oss-cn-hangzhou.aliyuncs.com/datax.tar.gz
步驟2:解壓安裝包到/opt/module下
tar -zxvf datax.tar.gz -C /opt/module/ |
步驟3:增加HighGo數(shù)據(jù)庫reader和writer支持
下載插件解壓至plugin下。
下載鏈接:https://pan.baidu.com/s/1Cqw3Zn9Q_dlsgQZbNcQedQ?pwd=bmde
3.DataX 配置
3.1.編寫同步任務(wù) job 配置文件
?下面配置將 mysql 中 mydb 庫下的 tb_datax 表的數(shù)據(jù)同步到 HighGo 數(shù)據(jù)庫 tb_datax 表里,其中 channel 是并發(fā)數(shù)量。
/opt/module/datax/job/mysql2highgo.json
{ |
3.2.執(zhí)行 datax.py
python /opt/module/datax/bin/datax.py /opt/module/datax/job/mysql2highgo.json |