Sync data between mysql using datax
Detailed reference
github:https://github.com/alibaba/DataX/wiki/Quick-Start
1. Download datax
wget http://datax-opensource.oss-cn-hangzhou.aliyuncs.com/datax.tar.gz
2. Unzip and modify directory permissions
tar zxvf datax.tar.gz
sudo chmod -R 755 datax
3. Execute a synchronous job
python datax.py ../job/job.json
4. Job format
{ "job": { "content": [ { "reader": { "name": "mysqlreader", "parameter": { "column": ["id_", "topic_id_", "speak_id_", "file_id_"], "connection": [ { "jdbcUrl": ["jdbc:mysql://*.*.*.*:3306/a?useUnicode=true&characterEncoding=UTF-8"], "table": ["a"] } ], "password": "*****", "username": "a", "where": "", "session": ["set names utf8mb4"] } }, "writer": { "name": "mysqlwriter", "parameter": { "column": ["id_", "topic_id_", "speak_id_", "file_id_"], "connection": [ { "jdbcUrl": "jdbc:mysql://*.*.*.*:3306/b?useUnicode=true&characterEncoding=UTF-8", "table": ["b"] } ], "password": "****", "username": "b", "where": "", "session": ["set names utf8mb4"] } } } ], "setting": { "speed": { "channel": "5" } } } }