配置仅限于跨不同网情况,网络互通情况方案和配置会更简单一点 内网A:Mysql数据转换成Csv { "job": { "setting": { "speed": {
配置仅限于跨不同网情况,网络互通情况方案和配置会更简单一点
内网A:Mysql数据转换成Csv
{
"job": {
"setting": {
"speed": {
"channel":1
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "root",
"passWord": "",
"connection": [
{
"querysql": [
"select id,name from table;"
],
"jdbcUrl": [
"jdbc:mysql://127.0.0.1/database"
]
}
]
}
},
"writer": {
"name": "txtfilewriter",
"parameter": {
"print": true,
"encoding": "UTF-8",
"path": "/result",
"fileName": "result.csv",
"writeMode": "truncate",
"dateFORMat": "YYYY-MM-dd hh:mm:ss",
"header":["id", "name"]
}
}
}
]
}
}
内网B:CSV导入到内网B配置:
{
"job": {
"setting": {
"speed": {
"channel": 2
}
},
"content": [
{
"reader": {
"name": "txtfilereader",
"parameter": {
"path":["D:/result/result.csv"],
"encoding": "UTF-8",
"column": [
{
"index": 0,
"name":"id",
"type": "long"
},
{
"index": 1,
"name":"name",
"type": "string"
}
],
"skipHeader": "true"
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"writeMode": "insert",
"username": "root",
"password": "",
"column": [
"id", "name"
],
"preSql": [
"truncate table table;"
],
"connection": [
{
"jdbcUrl": "jdbc:mysql://127.0.0.1:3306/table?characterEncoding=utf-8",
"table": [
"table"
]
}
]
}
}
}
]
}
}
注意编码和字段支持的类型,详细可查看DataX官方文档。
--结束END--
本文标题: DataX 离线跨网场景的实施配置
本文链接: https://lsjlt.com/news/4886.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0