Windows环境测试DataX3.0

1、安装Python

https://www.python.org/downloads/

备注:安装2.X版本,3.X版本执行会报错

2、安装JDK1.8+

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

配置环境变量

3、下载DataX工具包、配置示例、启动示例

https://github.com/alibaba/DataX/wiki/Quick-Start

{
    "job": {
        "content": [
            {
                "reader": {
                    "name": "mysqlreader",
                    "parameter": {
                        "username": "****",
                        "password": "****",
                        "column": ["rank","payment"],
						"where": "payment=3000",
                        "connection": [
                            {
                                "table": [
                                    "salary"
                                ],
                                "jdbcUrl": [
                                    "jdbc:mysql://127.0.0.1:3306/test"
                                ]
                            }
                        ]
                    }
                },
                "writer": {
                    "name": "odpswriter",
                    "parameter": {
                        "accessId": "****",
                        "accessKey": "****",
                        "column": ["rank","payment"],
                        "odpsServer": "http://service.odps.aliyun.com/api",
                        "project": "test",
                        "table": "salary",
                        "truncate": false
                    }
                }
            }
        ],
        "setting": {
            "speed": {
                "channel": 1
            }
        }
    }
}

备注:如果是增量同步,可以使用where参数

4、Windows下设置定时同步任务

a、编写bat脚本

python C:/datax/bin/datax.py C:/datax/bin/mysql2oracle.json
b、设置定时任务

参考:http://jingyan.baidu.com/article/d5c4b52bc3a11cda560dc5a7.html


你可能感兴趣的:(大数据)