testmysqltoelasticsearch75.json 未测试,仅参考

{
    "job": {
        "setting": {
            "speed": {
                "channel": 32,
                "batchSize":4096
            }
        },
        "content": [
            {
                "reader": {
                    "name": "mysqlreader",
                    "parameter": {
                        "splitPk": "LOTID",
                        "connection": [
                            {
                                "table": [
                                    "LOT"
                                ],
                                "jdbcUrl": [
                                    "jdbc:mysql://xxx:4000/xxx?useUnicode=true&characterEncoding=utf-8"
                                ]
                            }
                        ],
                        "where": "LOTID >= 200000000 and LOTID < 250000000",
                        "username": "xxx",
                        "password": "xxx",
                        "column": [
                            "LOTID",
                            "LOTNO",
                            "DATE_FORMAT(CREATEDDATE,'%Y-%m-%d %H:%i:%S') as CREATEDDATE"
                        ]
                    }
                },
                "writer": {
                    "name": "elasticsearchwriter",
                    "parameter": {
                        "endpoint": "http://xxx:9200",
                        "index": "lot",
                        "type":"_doc",
                        "settings": {"index" :{"number_of_shards": 3, "number_of_replicas": 1, "refresh_interval": "120s"}},
                        "discovery": false,
                        "dynamic": true,
                        "column": [
                          { "name": "LOTID", "type": "keyword"},
                          { "name": "LOTNO","type": "keyword" },
                          { "name": "CREATEDDATE","type": "date" }
                        ]
                    }
                }
            }
        ]
    }
}

 

posted @ 2021-09-08 14:50  DarJeely  阅读(27)  评论(0编辑  收藏  举报