Home > Database > Mysql Tutorial > SymmetricDS同步一个表的步骤

SymmetricDS同步一个表的步骤

WBOY
Release: 2016-06-07 16:12:04
Original
1351 people have browsed it

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')
Copy after login

一个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);
Copy after login

每一个表创建一个同步Trigger(还有Dead 类型的Trigger),并将这个表放到一个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);
Copy after login

创建一个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);
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template