官方地址:https://github.com/alibaba/DataX
安装部署:https://blog.csdn.net/paicmis/article/details/53563824
{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"column": ["id","created_time","updated_time","tenant_id","payload"],
"splitPk": "id",
"connection": [
{
"jdbcUrl": ["jdbc:mysql://11.11.86.22: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://10.10.0.22: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://11.1.1.22:3306/apollo_prod"]
}
],
"splitPk": "id",
"password": "*******",
"username": "******"
}
},
"writer": {
"name": "postgresqlwriter",
"parameter": {
"column": ["id","created_time","updated_time","tenant_id","payload"],
"connection": [
{
"jdbcUrl": "jdbc:postgresql://1.6.0.2:3433/appExtend",
"table": ["risk_data"]
}
],
"password": "********",
"postSql": [],
"preSql": ["delete from risk_data"],
"username": "********"
}
}
}
],
"setting": {
"speed": {
"channel": 10
}
}
}
}