DataX(2):安装DataX

1 官方地址

下载地址:http://datax-opensource.oss-cn-hangzhou.aliyuncs.com/datax.tar.gz

源码地址:https://github.com/alibaba/DataX

2 前置要求

  •  Linux
  •  JDK(1.8 以上,推荐 1.8)
  •  Python(推荐 Python2.6.X)

3 安装

(1)将下载好的 datax.tar.gz 上传指定服务器

(2)解压datax.tar.gz 到/opt/module

tar -zxvf datax.tar.gz -C /opt/module/

(3)运行自检脚本

#脚本所在目录
cd /opt/module/datax/bin/

#执行脚本
python datax.py /opt/module/datax/job/job.json

可能会报错:

DataX (DATAX-OPENSOURCE-3.0), From Alibaba !
Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved.


2023-04-08 19:38:49.635 [main] WARN  ConfigParser - 插件[streamreader,streamwriter]加载失败,1s后重试... Exception:Code:[Common-00], Describe:[您提供的配置文件存在错误信息,请检查您的作业配置 .] - 配置信息错误,您提供的配置文件[/opt/module/datax/plugin/reader/._drdsreader/plugin.json]不存在. 请检查您的配置文件. 
2023-04-08 19:38:50.638 [main] ERROR Engine - 

经DataX智能分析,该任务最可能的错误原因是:
com.alibaba.datax.common.exception.DataXException: Code:[Common-00], Describe:[您提供的配置文件存在错误信息,请检查您的作业配置 .] - 配置信息错误,您提供的配置文件[/opt/module/datax/plugin/reader/._drdsreader/plugin.json]不存在. 请检查您的配置文件.
	at com.alibaba.datax.common.exception.DataXException.asDataXException(DataXException.java:26)
	at com.alibaba.datax.common.util.Configuration.from(Configuration.java:95)
	at com.alibaba.datax.core.util.ConfigParser.parseOnePluginConfig(ConfigParser.java:153)
	at com.alibaba.datax.core.util.ConfigParser.parsePluginConfig(ConfigParser.java:125)
	at com.alibaba.datax.core.util.ConfigParser.parse(ConfigParser.java:63)
	at com.alibaba.datax.core.Engine.entry(Engine.java:137)
	at com.alibaba.datax.core.Engine.main(Engine.java:204)

执行如下命令:

cd /opt/module/datax/plugin/reader
rm -rf  ./._*
cd /opt/module/datax/plugin/writer
rm -rf  ./._*

如果没有报错,结果如下:

猜你喜欢

转载自blog.csdn.net/u013938578/article/details/130033349
今日推荐