SymmetricDS同步一個表的步驟,symmetricds同步

來源:互聯網
上載者:User

SymmetricDS同步一個表的步驟,symmetricds同步
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 類型的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);

建立一個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表。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.