如何在symmetricDs配置中避免从属端数据库中的sym_表?

时间:2017-11-24 11:01:41

标签: mysql database database-replication symmetricds

我在同一系统上运行的主节点和从节点从主服务器复制到从服务器,当我启动系统时,它将在主节点和从节点上生成sym_表。是否真的需要以单向复制方式工作。我试图在奴隶方添加以下属性

auto.config.database=false

但是它会停止同步本身,并且我在master sym_ tables中的条目如下所示

delete from sym_trigger_router;
delete from sym_trigger;
delete from sym_router;
delete from sym_channel where channel_id in ('item');
delete from sym_node_group_link;
delete from sym_node_group;
delete from sym_node_host;
delete from sym_node_identity;
delete from sym_node_security;
delete from sym_node;



insert into sym_channel 
(channel_id, processing_order, max_batch_size, enabled, description)
values('item', 1, 100000, 1, 'Item and pricing data');

insert into sym_node_group (node_group_id) values ('corp');
insert into sym_node_group (node_group_id) values ('store');

insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('corp', 'store', 'W');
insert into sym_node_group_link (source_node_group_id, target_node_group_id, data_event_action) values ('store', 'corp', 'P');



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



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

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



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



insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id) 
 values ('000','corp','000',1,null,null,null,null,null,current_timestamp,null,0,0,'000');
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id) 
 values ('001','store','001',1,null,null,null,null,null,current_timestamp,null,0,0,'000');



insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id) 
 values ('000','5d1c92bbacbe2edb9e1ca5dbb0e481',0,current_timestamp,0,current_timestamp,'000');
insert into sym_node_security (node_id,node_password,registration_enabled,registration_time,initial_load_enabled,initial_load_time,created_at_node_id) 
 values ('001','5d1c92bbacbe2edb9e1ca5dbb0e481',1,null,1,null,'000');


insert into sym_node_identity values ('000');

如果奴隶方不需要sym_表,请帮我避免

提前致谢

2 个答案:

答案 0 :(得分:3)

你说的是sym_而不是sys_表,不是吗?

是的,您需要目标节点上的sym_表。例如,如果没有sym_node目标节点,则无法注册并保持对源节点的注册。 sym_incoming_batch保存从目标服务器等同步的所有批量数据。

答案 1 :(得分:3)

auto.config.database告诉SymmetricDS您将自己管理SymmetricDS表的创建和维护。它们仍然是必需的。但是,您可以将SymmetricDS表放在与目标表不同的目录(数据库)中。

还有一个尚未记录的功能是设置通用的jdbc数据加载器并使用一个小的本地H2数据库作为SymmetricDS数据库。此选项仅适用于与客户端的单向同步。