data-center/dts_quickstart.md
2023-12-22 10:59:10 +08:00

156 lines
4.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 数据集成单任务配置使用datax
**1、安装datax**
安装参考[linux安装dataX-CSDN博客](https://blog.csdn.net/hzp666/article/details/127350768)
**2、配置datax同步mysql**
> 配置mysql隔离级别,进入mysql终端
>
> SET GLOBAL transaction_isolation='READ-COMMITTED';
配置数据源
jdbc:mysql://16gmaster:33060/studio?useUnicode=true&characterEncoding=utf8&useLocalSessionState=true
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/f1390cfe-078e-40a5-980a-009ac0d3a2ac">
<br/>
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/6dac7341-230d-423b-8b15-16d418240b83">
<br/>
配置执行器
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/925f40ee-2730-4c5e-b8e8-ccdac295d562">
<br/>
配置任务模版
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/6ec02640-046a-49f4-a9ef-05754c878c2a">
<br/>
配置单任务
按步骤选择数据抽取库数据合并库映射字段构建datax的可执行json文件选择任务模版点击下一步任务就创建完成了可以在任务详情里查看
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/3139101f-0cba-4e44-a82f-62f19cf7dfa1">
<br/>
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/3e0b4250-1200-4f2f-9ed3-8fde2cc4b8f4">
<br/>
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/1a9cc66e-9951-41e3-89af-77e830b77ad0">
<br/>
<br/>
<img width="1215" alt="image" src="https://github.com/alldatacenter/alldata/assets/20246692/7488c7ee-311f-446f-b35c-07091e1aba8d">
<br/>
最后可以运行的json文件
```json
{
"job": {
"setting": {
"speed": {
"channel": 1,
"bytes": 0
},
"errorLimit": {
"record": 100
},
"restore": {
"maxRowNumForCheckpoint": 0,
"isRestore": false,
"restoreColumnName": "",
"restoreColumnIndex": 0
},
"log": {
"isLogger": false,
"level": "debug",
"path": "",
"pattern": ""
}
},
"content": [{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "root",
"password": "123456",
"column": [
"menu_id",
"pid",
"sub_count",
"type",
"title",
"name",
"component",
"menu_sort",
"icon",
"path",
"i_frame",
"cache",
"hidden",
"permission",
"create_by",
"update_by",
"create_time",
"update_time"
],
"splitPk": "",
"connection": [{
"table": [
"sys_menu_source"
],
"jdbcUrl": [
"jdbc:mysql://16gmaster:33060/studio?useUnicode=true&characterEncoding=utf8&useLocalSessionState=true"
]
}]
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"username": "root",
"password": "123456",
"writeMode": "insert",
"column": [
"menu_id",
"pid",
"sub_count",
"type",
"title",
"name",
"component",
"menu_sort",
"icon",
"path",
"i_frame",
"cache",
"hidden",
"permission",
"create_by",
"update_by",
"create_time",
"update_time"
],
"connection": [{
"table": [
"sys_menu_target"
],
"jdbcUrl": "jdbc:mysql://16gmaster:33060/studio?useUnicode=true&characterEncoding=utf8&useLocalSessionState=true"
}]
}
}
}]
}
}
```