Skip to content

Commit

Permalink
docs: 新增全局数据库配置例子
Browse files Browse the repository at this point in the history
  • Loading branch information
Breeze0806 committed Jul 2, 2023
1 parent 27af1aa commit e6cb789
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README_USER.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ ignoreOneByOneError 是否忽略一个个重试错误
2. 类型有`forever`,指永久重复重试策略,`"strategy":{"wait":"1s"}`,wait代表等待时间
3. 类型有`exponential`,指幂等重复重试策略,`"strategy":{"init":"100ms","max":"4s"}`,init代表开始时间,max代表最大时间

##### 2.1.3.3 测试数据

```bash
datax -c examples/global/config.json
```

#### 2.1.4 使用切分键

这里假设数据按切分键分布是均匀的,合理使用这样的切分键可以使同步更快,另外为了加快对最大值和最小值的查询,这里对于大表可以预设最大最小值
Expand Down
69 changes: 69 additions & 0 deletions cmd/datax/examples/global/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"core" : {
"container": {
"job":{
"id": 1,
"sleepInterval":100
}
}
},
"job":{
"content":[
{
"reader":{
"name": "mysqlreader",
"parameter": {
"username": "root",
"password": "123456",
"column": ["*"],
"connection": {
"url": "tcp(192.168.15.130:3306)/source?parseTime=false",
"table": {
"db":"source",
"name":"type_table"
}
},
"where": ""
}
},
"writer":{
"name": "mysqlwriter",
"parameter": {
"username": "root",
"password": "123456",
"writeMode": "insert",
"column": ["*"],
"session": [],
"preSql": [],
"connection": {
"url": "tcp(192.168.15.130:3306)/mysql?parseTime=false",
"table": {
"db":"destination",
"name":"type_table"
}
},
"batchTimeout": "1s",
"batchSize":1000
}
},
"transformer":[]
}
],
"setting":{
"pool":{
"maxOpenConns":8,
"maxIdleConns":8,
"connMaxIdleTime":"40m",
"connMaxLifetime":"40m"
},
"retry":{
"type":"ntimes",
"strategy":{
"n":3,
"wait":"1s"
},
"ignoreOneByOneError":true
}
}
}
}

0 comments on commit e6cb789

Please sign in to comment.