DataX数据同步
{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader", #reader名称,固定,不可修改
"parameter": {
"column": [ #同步的字段
"id",
"name"
],
"where": "id>=3",# 查询条件,也可以不带
"connection": [
{
"jdbcUrl": [
"jdbc:mysql://127.0.0.1:3306/test" #读的库
],
"table": [
"test" #表
]
}
],
"password": "123456", #密码
"splitPk": "",
"username": "root" #用户
}
},
#写的库
"writer": {
"name": "mysqlwriter", #reader名称,固定,不可修改
"parameter": {
"username": "root", #数据库用户
"password": "123456",#数据库密码
"connection": [
{
"table": [
"test1" #目标表
],
"jdbcUrl": "jdbc:mysql://127.0.0.1:3306/test2?useUnicode=true&characterEncoding=utf-8"
}
],
"column": [ #对应字段,也可以*代表全部字段
"id",
"name"
],
"writeMode": "replace" #insert into(insert) replace into
#replace 或者 update
}
}
}
],
"setting": {
"speed": {
"channel": 1 #并发数
}
}
}
}