dataX json配置

1.mysql2mysql的例子

{
    "job":{
        "content":[
            {
                "reader":{
                    "name":"mysqlreader",
                    "parameter":{
                        "column":[
                            "id",
                            "name"
                        ],
                        "connection":[
                            {
                                "jdbcUrl":[
                                    "jdbc:mysql://127.0.0.1:3306/dq"
                                ],
                                "table":[
                                    "table1"
                                ]
                            }
                        ],
                        "password":"123456",
                        "username":"root"
                    }
                },
                "writer":{
                    "name":"mysqlwriter",
                    "parameter":{
                        "column":[
                            "id",
                            "name"
                        ],
                        "connection":[
                            {
                                "jdbcUrl":"jdbc:mysql://ip地址:端口/test",
                                "table":[
                                    "table2"
                                ]
                            }
                        ],
                        "password":"123456",
                        "username":"root"
                    }
                }
            }
        ],
        "setting":{
            "speed":{
                "channel":"1"
            }
        }
    }
}

 

2.mysql到本地:

{
    "job":{
        "content":[
            {
                "reader":{
                    "name":"mysqlreader",
                    "parameter":{
                        "username":"root",
                        "password":"root",
                        "column":[
                            "ID",
                            "VISIT_IP"
                        ],
                        "connection":[
                            {
                                "table":[
                                    "visit_log"
                                ],
                                "jdbcUrl":[
                                    "jdbc:mysql://192.168.0.197:3306/qyyx_test"
                                ]
                            }
                        ]
                    }
                },
                "writer":{
                    "name":"streamwriter",
                    "parameter":{
                        "print":false,
                        "encoding":"UTF-8"
                    }
                }
            }
        ]
    }
}

 

3.HDFS打印到本地控制台

{
    "job":{
        "setting":{
            "speed":{
                "channel":3
            }
        },
        "content":[
            {
                "reader":{
                    "name":"hdfsreader",
                    "parameter":{
                        "path":"/user/hive/warehouse/test.db/nnn/*",
                        "defaultFS":"hdfs://192.168.200.45:8020",
                        "column":[
                            "*"
                        ],
                        "fileType":"orc",
                        "encoding":"UTF-8",
                        "fieldDelimiter":","
                    }
                },
                "writer":{
                    "name":"streamwriter",
                    "parameter":{
                        "print":true
                    }
                }
            }
        ]
    }
}

4.orcle打印到Linux

{
    "job":{
        "setting":{
            "speed":{
                "channel":5
            }
        },
        "content":[
            {
                "reader":{
                    "name":"oraclereader",
                    "parameter":{
                        "username":"edw_src",
                        "password":"123456",
                        "where":"",
                        "connection":[
                            {
                                "querySql":[
                                    "select * from ORDER_DETAIL_BAK"
                                ],
                                "jdbcUrl":[
                                    "jdbc:oracle:thin:@192.168.0.197:1521:orcl"
                                ]
                            }
                        ]
                    }
                },
                "writer":{
                    "name":"streamwriter",
                    "parameter":{
                        "visible":true,
                        "encoding":"UTF-8"
                    }
                }
            }
        ]
    }
}

 

5.sqlserver to mysql

{
  "job": {
    "content": [
      {
        "reader": { //读入库配置,比如说是sql server "name": "", //数据源名称,别瞎写 "parameter": {} //数据库配置信息 }, "writer": { //写入库配置,比如说是mysql "name": "", //数据源名称,别瞎写 "parameter": {} //数据库配置信息 } } ], "setting": { //基本设置 "speed": { //流量控制 "channel": 1, //同步时候的并发数 "byte": 104857600 //同步时候的字节大小,影响速度 }, "errorLimit": { //脏数据控制 "record": 10, //脏数据最大记录数阈值 "percentage": 0.05 //脏数据占比阈值 } } } }

转载于:https://www.cnblogs.com/longbing/p/9430084.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值