DataX使用

it2022-05-05  113

官方地址:https://github.com/alibaba/DataX 安装部署:https://blog.csdn.net/paicmis/article/details/53563824

datax split目前仅支持单一主键,且主键类型是int或者varchar类型splitPk有值时,channel才会生效,否则都是单通道执行

 

{ "job": { "content": [ { "reader": { "name": "mysqlreader", "parameter": { "column": ["id","created_time","updated_time","tenant_id","payload"], "splitPk": "id", "connection": [ { "jdbcUrl": ["jdbc:mysql://ip:3306/apollo_prod?autoReconnect=true"], "table": ["risk_data"] } ], "password": "******", "username": "****", "where": "" } }, "writer": { "name": "postgresqlwriter", "parameter": { "column": ["id","created_time","updated_time","tenant_id","payload"], "connection": [ { "jdbcUrl": "jdbc:postgresql://ip:3433/appExtend", "table": ["risk_data"] } ], "password": "*******", "postSql": [], "preSql": ["delete from risk_data"], "username": "******" } } } ], "setting": { "speed": { "channel": 10 } } } } //自定义sql { "job": { "content": [ { "reader": { "name": "mysqlreader", "parameter": { "connection": [ { "querySql": ["select id,created_time,updated_time,tenant_id,payload from risk_data limit 1000;"], "jdbcUrl": ["jdbc:mysql://ip:3306/apollo_prod"] } ], "splitPk": "id", "password": "*******", "username": "******" } }, "writer": { "name": "postgresqlwriter", "parameter": { "column": ["id","created_time","updated_time","tenant_id","payload"], "connection": [ { "jdbcUrl": "jdbc:postgresql://ip:3433/appExtend", "table": ["risk_data"] } ], "password": "********", "postSql": [], "preSql": ["delete from risk_data"], "username": "********" } } } ], "setting": { "speed": { "channel": 10 } } } }

 

 

最新回复(0)