2

To all those SymmetricDS nerds over there, this one's for you all.

Right, so we have a main db, DB-01. We have 3 instances of our application running namely R1,R2,R3. Each instance has its own in-memory db namely D1,D2,D3 which it(application) is accessing respectively. We are using SymmetricDS to do one-way sync from DB-01 to D1,D2,D3. So, there is a server node, corporate C0, pointing to DB-01 and 3 client nodes, stores S1,S2,S3 pointing to D1,D2,D3 respectively.

All is working fine.

But now, we would like to introduce High Availability and there by FAILOVER into this topology i.e., at any time there will be 2 server nodes running, say Master and Slave, that would be accessing the same DB-01. If Master server goes down, clients should automatically connect to the Slave node and continue operation.

What all might be the configuration changes required to accomplish this? Are there any examples or documentations that i can reproduce to understand this concept?

Connell.O'Donnell
  • 3,603
  • 11
  • 27
  • 61
Phillip
  • 437
  • 1
  • 5
  • 16
  • 1
    Have you looked at clustering configuration: https://www.symmetricds.org/doc/3.8/html/user-guide.html#_clustering ? – Boris Pavlović Dec 11 '17 at 10:01
  • @BorisPavlović: i understand that clustering is providing both load balancing and failover and this requires an external load balancer. But we don't require any load balancing. Is there any alternate way. If not, could you suggest any good load balancers for linux? – Phillip Dec 11 '17 at 11:58
  • Try Apache's implementation: https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html there are tons of resources on how to configure it – Boris Pavlović Dec 11 '17 at 12:28
  • @BorisPavlović: One more question, if i create 2 server nodes pointing to the same DB, wouldn't it throw an exception? – Phillip Dec 11 '17 at 12:29
  • There are settings for each node that are defining lock parameters keeping the instances in line with parallel access to the db – Boris Pavlović Dec 11 '17 at 12:30
  • Are you talking about these settings: `cluster.lock.during.purge=true cluster.lock.during.pull=true cluster.lock.during.push=true cluster.lock.during.heartbeat=true cluster.lock.during.sync.triggers=true`. Do let me know if i missed something. – Phillip Dec 11 '17 at 12:32
  • Yes, for more take a look at: https://www.symmetricds.org/doc/3.8/html/user-guide.html#_clustering – Boris Pavlović Dec 11 '17 at 12:33
  • 1
    Thanks, for the help. Let me see if i can test it out. – Phillip Dec 11 '17 at 12:35

1 Answers1

0

We do this via clustering with 2 SymmetricDS services running on 2 app servers pointing to the High Availability (HA) connections. Then all you need is HA connections to failover like normal and Symmetric DS clustering does the rest.

Link for the user manual on clustering.

https://www.symmetricds.org/doc/3.13/html/user-guide.html#_clustering

EDIT let me get some configs for you on here service 1:

engine.name=<SDS_SERVICE_1>

db.driver=net.sourceforge.jtds.jdbc.Driver
db.url=jdbc:jtds:sqlserver://<HA_connection1>:1433/<DB>;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880
db.user=***********
db.password=***********

registration.url=http://<IP>:7004/sync/<SDS_MAIN>
sync.url=http://<IP>:7004/sync/<SDS_SERVICE_1>

group.id=<GID>
external.id=100

auto.registration=true
initial.load.create.first=true

sync.table.prefix=sym
start.initial.load.extract.job=false

cluster.lock.enabled=true
cluster.server.id=11
cluster.lock.timeout.ms=600000
cluster.lock.refresh.ms=60000

compression.level=-1
compression.strategy=0

Service 2:

engine.name=<SDS_SERVICE_2>

db.driver=net.sourceforge.jtds.jdbc.Driver
db.url=jdbc:jtds:sqlserver://<HA_connection2>:1433/<DB>;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880
db.user=***********
db.password=***********

registration.url=http://<IP>:7004/sync/<SDS_MAIN>
sync.url=http://<IP>:7004/sync/<SDS_SERVICE_2>

group.id=<GID>
external.id=100

auto.registration=true
initial.load.create.first=true

sync.table.prefix=sym
start.initial.load.extract.job=false

cluster.lock.enabled=true
cluster.server.id=12
cluster.lock.timeout.ms=600000
cluster.lock.refresh.ms=60000

compression.level=-1
compression.strategy=0
EST
  • 407
  • 1
  • 7
  • 10