Reputation: 1688
I am trying to set up a bi-directional symmetricDS sinchronization on 2 postgres DBs, but so far I was only able to chieve, one way synchronimzation: from slave to master.
These are my engines config files:
master:
sync.url=http\://192.168.1.199\:31415/sync/symmetricdsmwdb0
registration.url=http\://192.168.1.199\:31415/sync/symmetricdsmwdb0
group.id=primary
db.init.sql=
db.driver=org.postgresql.Driver
db.user=user
db.password=password
db.url=jdbc\:postgresql\://mw-db\:5432/mw?protocolVersion\=3&stringtype\=unspecified&socketTimeout\=300&tcpKeepAlive\=true
engine.name=symmetricdsmwdb0
external.id=symmetricdsmwdb0
db.validation.query=select 1
cluster.lock.enabled=false
auto.registration=true
auto.reload=true
slave:
sync.url=http\://192.168.1.84\:31415/sync/symmetricdsmwdb1
group.id=primary
db.init.sql=
registration.url=http\://192.168.1.199\:31415/sync/symmetricdsmwdb0
db.driver=org.postgresql.Driver
db.user=user
db.password=password
db.url=jdbc\:postgresql\://mw-db\:5432/mw?protocolVersion\=3&stringtype\=unspecified&socketTimeout\=300&tcpKeepAlive\=true
engine.name=symmetricdsmwdb1
external.id=symmetricdsmwdb1
db.validation.query=select 1
cluster.lock.enabled=false
The trigger definiton looks like this:
INSERT INTO sym_trigger (trigger_id, source_schema_name, source_table_name, channel_id, sync_on_update, sync_on_insert, sync_on_delete, sync_on_update_condition, sync_on_insert_condition, sync_on_delete_condition, last_update_time, create_time, sync_on_incoming_batch)
VALUES ('public.tables', 'public', '*', 'default', 1, 1, 1, '1=1', '1=1', '1=1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 1);
INSERT INTO sym_trigger_router (trigger_id, router_id, enabled, initial_load_order, create_time, last_update_time)
VALUES ('public.tables', 'primary to primary', 1, 10, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
When I'm changing something in one of the public schema tables in the slave DB instance, the changes are being propagated to the master DB. But when I operate similar changes in the master DB, then changes are not being pushed to the slave DB.
Any idea what am I missing here to have a bi-directional propagation?
Thanks
Upvotes: 0
Views: 97
Reputation: 31
Run the following command on the master node:
symadmin -e symmetricdsmwdb0 sync-triggers -f
Upvotes: 1