SymmetricDS Active-Active able to replicate client-master but failed to replicate master-client

43 Views Asked by At

I have problem replicating the Active-Active SymmetricDS. From the client server, I can insert, update and delete the record, and also it is replicated to the master without any problem.

But from the Master, any insert, update and delete that I had made were not replicated to the client.

The 2 servers that I have :

  • Master with public ip
  • client with only local ip

Here is the gt2_master.properties in master server :

db.connection.properties=
sync.url=http\://{cloudip}\:31415/sync/gt2_master
group.id=gt2
db.init.sql=
db.driver=org.postgresql.Driver
db.user=dbuser
db.password=dbpass
engine.name=gt2_master
external.id=1
db.validation.query=select 1
cluster.lock.enabled=false
registration.url=
db.url=jdbc\:postgresql\://{cloudip}:5432/gt2?protocolVersion\
=3&stringtype\=unspecified&socketTimeout\=300&tcpKeepAlive\=true

job.purge.period.time.ms=7200
job.routing.period.time.ms=1000
job.push.period.time.ms=1000
job.pull.period.time.ms=1000
auto.registration=true
initial.load.create.first=true

And here is my gt2_client.properties on client :

db.connection.properties=
sync.url=http\://192.168.100.203\:31415/sync/gt2_client
group.id=gt2
db.init.sql=
db.driver=org.postgresql.Driver
db.user=dbuser
db.password=dbpass
engine.name=gt2_client
external.id=2
db.validation.query=select 1
cluster.lock.enabled=false
registration.url=http\://{cloudip}\:31415/sync/gt2_master
db.url=jdbc\:postgresql\://192.168.100.203:5432/gt2?protocolVersion\
=3&stringtype\=unspecified&socketTimeout\=300&tcpKeepAlive\=true

job.routing.period.time.ms=1000
job.push.period.time.ms=1000
job.pull.period.time.ms=1000
auto.registration=true

bin/sym_service starts running without any error log. Then i run this command in master :

INSERT INTO sym_node_group_link (source_node_group_id,target_node_group_id,data_event_action)
VALUES ('gt2','gt2','P');

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)
VALUES ('public.all', 'public', '*', 'default', 1, 1, 1, '1=1', '1=1', '1=1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);

INSERT INTO sym_router (router_id,source_node_group_id,target_node_group_id,router_type,router_expression,sync_on_update,sync_on_insert,sync_on_delete,use_source_catalog_schema,create_time,last_update_by,last_update_time)
VALUES ('gt2_2_gt2', 'gt2', 'gt2', 'default', NULL, 1, 1, 1, 0, CURRENT_TIMESTAMP, 'console', CURRENT_TIMESTAMP);

INSERT INTO sym_trigger_router (trigger_id, router_id, enabled, initial_load_order, create_time, last_update_time)
VALUES ('public.all', 'gt2_2_gt2', 1, 10, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);

All sym_* table and sym_ trigger were created. Finally i run this in master :

bin/symadmin open-registration --engine gt2_master gt2 gt2_client

bin/symadmin send-schema --engine gt2_master -n gt2_client

In client server there is no error in log but in the master server there is a warning error :

WARN [gt2_master] [PushService] [gt2_master-push-default-41] 
Could not communicate with gt2:2:2 at http://192.168.100.203:31415/sync/gt2_client 
because exception org.jumpmind.exception.
IoException: java.net.SocketTimeoutException: Connect timed out

What is wrong with my configuration or postgresql command ?

0

There are 0 best solutions below