• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

SymmetricDS同步一个表的步骤

mysql 搞代码 4年前 (2022-01-09) 18次浏览 已收录 0个评论

1. 创建一个channel insert into sym_channel(channel_id, processing_order, max_batch_size, enabled, description)values(test, 1, 100000, 1, channel test for table test) 一个channel是一个或多个希望在一个事务中同步的表的集合 2. 为要同步的表创建

1. 创建一个channel

insert into sym_channel(channel_id, processing_order, max_batch_size, enabled, description)values('test', 1, 100000, 1, 'channel test for table test')

一个channel是一个或多个希望在一个事务中同步的表的集合

2. 为要同步的表创建Trigger

insert into sym_trigger(trigger_id,source_table_name,channel_id,last_update_time,create_time)values('test','test','test',current_timestamp,current_timestamp);

每一个表创建一个同步Trigger(还有Dead 类型的Trigge本文来源gao@daima#com搞(%代@#码网r),并将这个表放到一个channel中。

3.创建Router

insert into sym_router(router_id,source_node_group_id,target_node_group_id,router_type,create_time,last_update_time)values('test_2_test', 'corp', 'store', 'default',current_timestamp, current_timestamp);

创建一个Router,Router具有方向的概念。并且可以对数据进行过滤。

4.创建Trigger-Router Link

insert into sym_trigger_router(trigger_id,router_id,initial_load_order,last_update_time,create_time)values('test','test_2_test', 100, current_timestamp, current_timestamp);

需要将Trigger和Router联系起来,也就是将Trigger获取的数据传递到Router中,然后Router再往其他节点发送。Trigger和Router是多对多的关系。所以需要一个Join表的存在。这就是那个Join表。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:SymmetricDS同步一个表的步骤
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址