0% found this document useful (0 votes)
64 views2 pages

SymmetricDS Sync Setup Guide

This document provides instructions for quickly setting up and testing data synchronization between a master database and client databases using SymmetricDS. The steps include: 1. Importing the application and SymmetricDS schemas and sample data into the master database. 2. Starting the SymmetricDS service and monitoring the logs for errors. 3. Testing synchronization between databases by inserting sample data and verifying it is replicated. 4. Testing different router types including default routers that sync all data and a column router that selectively syncs data based on column conditions. 5. Explaining triggers can be used to control synchronization but examples are not yet provided.

Uploaded by

inc0gnit0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views2 pages

SymmetricDS Sync Setup Guide

This document provides instructions for quickly setting up and testing data synchronization between a master database and client databases using SymmetricDS. The steps include: 1. Importing the application and SymmetricDS schemas and sample data into the master database. 2. Starting the SymmetricDS service and monitoring the logs for errors. 3. Testing synchronization between databases by inserting sample data and verifying it is replicated. 4. Testing different router types including default routers that sync all data and a column router that selectively syncs data based on column conditions. 5. Explaining triggers can be used to control synchronization but examples are not yet provided.

Uploaded by

inc0gnit0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

QUICK START

Setup Sync
0) cd ke symmetricds install dir (i.e $HOME/working/symmetric-server-3.9.2)
1) buat schema table aplikasi di db induk
./bin/dbimport --engine induk-000 --format XML --alter-case
samples/create_sample.xml

2) buat schema tabel-tabel sym di db induk


./bin/symadmin --engine induk-000 create-sym-tables

3) insert sample data ke db induk


./bin/dbimport --engine induk-000 samples/insert_sample.sql

4) start symmetricds service:


./bin/sym_service start

5) amati log:
tail -f logs/symmetric.log

6) jika tidak ada error (java exception) maka coba insert di induk dan di kedai.

Testing Sync
Testing router
router ada di table sym_router

Test router yang bertype default (router_type = default)


ada 2 router type default: induk_2_kedai , kedai_2_induk

1) induk_2_kedai: source group: induk, target group: kedai


di database induk:
INSERT INTO item (item_id,name) VALUES (99000001,'robot pemburu tikus 0x8080');

cek log, lalu cek hasil sync di database kedai01 dan kedai02:
SELECT * FROM item WHERE item_id = 99000001;

2) kedai_2_induk: source group: kedai, target group: induk


di database kedai01:
INSERT INTO sale_transaction (tran_id,kedai_id,workstation,day,seq) VALUES
(9901,'001',3,CAST(now() as DATE),90);

cek log, lalu cek hasil sync di database induk


SELECT * FROM sale_transaction WHERE tran_id=9901;
Test router yang bertype column (router_type = column)
Hanya ada 1 router type column:

induk_2_one_kedai: source group: induk, target group: kedai,


bedanya dg router bertype default adalah router ini men-sync data secara selektif, tidak ke semua
node di group kedai, tapi hanya yg memenuhi kondisi di router_expression,

router induk_2_one_kedai mempunyai router_expression sbb:


KEDAI_ID=:EXTERNAL_ID or OLD_KEDAI_ID=:EXTERNAL_ID

(artinya: data hanya di sync pada record yg memenuhi syarat kedai_id = :external_id atau
nilai old kedai_id= :external_id , nilai old adalah nilai sebelum diubah)

di database induk:
UPDATE item_selling_price SET price=price*1000,cost=cost*1000 WHERE item_id =
11000001 and kedai_id='001';

cek log, lalu cek hasil sync di database kedai01 (jika sync sukses maka record tsb harus ada)
SELECT * FROM item_selling_price WHERE item_id = 11000001;

lalu cek hasil sync di database kedai02 dg query yg sama (record tsb seharusnya *tidak* ada)

Testing trigger
Trigger ada di tabel sym_trigger
catatan: terutama dengan sync_on_incoming_batch, external_select, tx_id_expression,

channel_expression, ini adalah konsep2 yg tidak ada di versi 1.x

(yet to be done)

You might also like