标签:主键 密码 content gui cat asi img com CMF
方案:
1.mq -- insert update 哪些地方涉及到 都得处理/ 一张表两个队列/ /专家库要写一张表至少两个监听/ 数据库变更我也得变更
2.dblink
show engines;
开启federated引擎没有则安装插件
CREATE TABLE school (
`id` varchar(10) NOT NULL DEFAULT ‘‘ COMMENT ‘主键id‘,
`school_name` varchar(10) DEFAULT NULL COMMENT ‘学校名称‘,
PRIMARY KEY (`id`)
) ENGINE=FEDERATED DEFAULT CHARSET=utf8
COMMENT=‘学校表-远程表‘ CONNECTION=‘mysql://root:12345678@localhost:3306/test/school‘;
-- root:root 远程数据库的账号和密码
-- localhost:3306 远程数据库的ip和端口
-- b 远程数据库的名称
-- school 远程数据库的表名称
3.datax 阿里巴巴离线数据同步
{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "root",
"password": "root",
"column": ["*"],
"splitPk": "id",
"connection": [
{
"table": [
"stcsm_user_unit"
],
"jdbcUrl": [
"jdbc:mysql://139.196.142.114:3306/stcsm_user?useUnicode=true&characterEncoding=utf8"
]
}
]
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"writeMode": "insert",
"username": "root",
"password": "root",
"column": [
"*"
],
"session": [
"set session sql_mode=‘ANSI‘"
],
"preSql": [
"truncate stcsm_user_unit"
],
"connection": [
{
"jdbcUrl": "jdbc:mysql://139.196.142.114:3306/stcsm_expert_apply?useUnicode=true&characterEncoding=utf8",
"table": [
"stcsm_user_unit"
]
}
]
}
}
}
],
"setting": {
"speed": {
"channel": 5
}
}
}
}
数据同步工具
标签:主键 密码 content gui cat asi img com CMF
原文地址:https://www.cnblogs.com/ywsheng/p/11250057.html