1、从mysql到mysql
{
"job": {
"setting": {
"speed": {
"channel": 3,
"byte": 1048576
},
"errorLimit": {
"record": 0,
"percentage": 0.02
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "root",
"password": "123456",
"column": [
"`pid`",
"`name`",
"`sex`",
"`education`"
],
"splitPk": "",
"connection": [
{
"table": [
"icr_name"
],
// "querySql": [],
"jdbcUrl": [
"jdbc:mysql://xxxx:3306/portal"
]
}
]
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"username": "xxxx",
"password": "xxxx",
"writeMode": "update",
"column": [
"`id`",
"`res_name`",
"`gender`",
"`education`"
],
"connection": [
{
"table": [
"t_base_expert_info"
],
"jdbcUrl": "jdbc:mysql://xxxx/etcc_natural_disaster"
}
]
}
}
}
]
}
}
2、从mysql到es
{
"job": {
"setting": {
"speed": {
"channel": 1
},
"errorLimit": {
"percentage": 0
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "xxxx",
"password": "xxxx",
"connection": [
{
"querySql": [
"SELECT id,'n_base_hospital' AS baseResourceType,res_type,status,res_name AS resName,longitude,latitude,CONCAT_WS(',',latitude,longitude) AS location,created_at AS createdAt,updated_at AS updatedAt,deleted FROM t_base_hospital WHERE deleted=0 AND !ISNULL(longitude) AND LENGTH(longitude)>0"
],
"jdbcUrl": [
"jdbc:mysql://xxxx:3306/etcc_natural_disaster"
]
}
]
}
},
"writer": {
"name": "elasticsearchwriter",
"parameter": {
"endpoint": "http://xxxx:9200",
"index": "n_base_hospital",
"type": "_doc",
"accessId": "",
"accessKey": "",
"cleanup": true,
"dynamic": true,
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
}
},
"discovery": false,
"batchSize": 1000,
"splitter": ",",
"column": [
{
"name": "id",
"type": "keyword"
},
{
"name": "baseResourceType",
"type": "keyword"
},
{
"name": "resType",
"type": "keyword"
},
{
"name": "status",
"type": "integer"
},
{
"name": "resName",
"type": "text"
},
{
"name": "longitude",
"type": "keyword"
},
{
"name": "latitude",
"type": "keyword"
},
{
"name": "location",
"type": "geo_point"
}
]
}
}
}
]
}
}
3、普通的定时任务(shell任务)
curl -i -X GET -H 'Content-type':'application/json' http://xxxx