1.环境安装
1.1下载java1.8
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
1.2解压
tar xf jdk-8u131-linux-x64.tar.gz -C /usr/local
mv jdk1.8.0_131/ java
1.3配置环境变量
vim /etc/profile
JAVA_HOME=/usr/local/java
PATH=${JAVA_HOME}/bin:$PATH
#刷新环境变量
source /etc/profile
1.4验证是否安装完成
java -version
ava version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
2.安装datax
2.1选择安装路径
cd /usr/local
2.2下载安装包
wget http://datax-opensource.oss-cn-hangzhou.aliyuncs.com/datax.tar.gz
若提示无法找到wget工具,请执行安装命令:yum -y install wget
2.3解压至安装路径
tar xf datax.tar.gz -C /usr/local/
2.4添加环境变量
vim /etc/profile
export DATAX_HOME=/usr/local/datax
export PATH=$PATH:$DATAX_HOME/bin
#刷新环境变量
source /etc/profile
2.5验证datax是否安装成功
删除隐藏文件,否则会报错
注意修改删除路径
rm -rf /usr/local/datax/plugin/*/._*
验证datax是否安装成功
datax.py /usr/local/datax/job/job.json
3. 模板文件参考
mysql迁移:
https://www.jianshu.com/p/25f7ec72e7db?v=1683701902689