Canton HA setup

Hi team,

I’m working on the canton code in examples/e04-high-availability. I notice that we need separate databases for mediator, sequencer and domain manager. Is it possible to use ONE database for all of them? Any reasons (schemas? or others) that I need different databases?

When I use one database, I got this errors.
2021-12-21 10:46:29,864 [main] ERROR c.d.canton.CantonEnterpriseApp$ - CONFIG_VALIDATION_ERROR(8,0): Failed to validate the configuration due to: Nodes manager domain,sequencer sequencer_a,mediator mediator_a share same DB access: DbAccess(jdbc:oracle:thin:@10.206.51.13:1888/psyndb1,Some(DD4ODRUN)) err-context:{causes=List(Nodes manager domain,sequencer sequencer_a,mediator mediator_a share same DB access: DbAccess(jdbc:oracle:thin:@10.206.51.13:1888/psyndb1,Some(DD4ODRUN)))), location=CantonConfig.scala:1234}

Many thanks.

kc

Hey @kctam,

In the HA configuration the sequencer, mediator and domain manager are all acting as separate nodes on the domain, and may have slightly different views of data dependent on their role. Practically if you try to run them in a same database they will all try to write this slightly different data to the same tables and create quite a mess, hence why we have the validation you hit to prevent this from happening. (This is in contrast having a non-HA single domain node which only needs a single database.)

The easiest way to get this working is just to create many databases on the same database server. However you could perhaps use schemas within the same database to isolate each node from one other and then craft an appropriate connection string to have the nodes use this config. However I’m uncertain if the validation will stick in and complain.

David.

2 Likes