zoukankan      html  css  js  c++  java
  • DataX 安装和使用

    阿里云介绍

    1. 下载安装包。作为阿里主要的数据传输工具Datax,阿里已经完全开源到github上面了。下载地址(https://github.com/alibaba/DataX)。

    2. 安装环境:

    • JDK(1.6以上,推荐1.6)
    • Python(推荐Python2.6.X)
    • Apache Maven 3.x (Compile DataX)

    3. 解压到工作目录。/usr/local/datax

    4. 编写源和目标表的json文件

    {
        "job": {
            "setting": {
                "speed": {
                     "channel": 3
                },
                "errorLimit": {
                    "record": 0,
                    "percentage": 0.02
                }
            },
            "content": [
                {
                    "reader": {
                        "name": "mysqlreader",
                        "parameter": {
                            "writeMode": "insert",
                            "username": "root",
                            "password": "******",
                            "column": [
                                "rec_id",
                                "column",
                                "etl_time"
                            ],
                            "connection": [
                                {
                                    "table": [
                                        "source_table"
                                    ],
                                    "jdbcUrl": [
         "jdbc:mysql://11.278.80.200:34001/DW"
                                    ]
                                    
                                }
                            ]
                        }
                    },
                    "writer": {
                        "name": "mysqlwriter",
                        "parameter": {
                            "username": "root",
                            "password": "*****",
                            "column": [
                                "rec_id",
                                "column",
                                "etl_time"
                            ],
                            "connection": [
                                {
                                    "jdbcUrl": "jdbc:mysql://10.208.83.202:30001/DW",
                                    "table": [
                                        "target_table"
                                    ]
                                }
                            ],              
                        }
                    }
                }
            ],
            "setting": {
                "speed": {
                    "channel": 1
                },
                "errorLimit": {         
                    "record": 10
                }
            }
        }
    }

    5. 运行脚本

    python /home/admin/datax3/bin/datax.py ./json/table_1.json
  • 相关阅读:
    JQuery图片预览
    1.数组
    1.什么是C++
    安装PHPCMS 遇到的问题(fsockpen)
    解决采集时提示”没有找到网址列表,请先进行网址采集“的问题
    JAVA 常用的网站
    页面静态化
    我的C笔记系列一
    PHP缓存技术
    PHPCMS 采集规则
  • 原文地址:https://www.cnblogs.com/Jesse-Li/p/9983137.html
Copyright © 2011-2022 走看看