Running HA domain with the same database


I’m trying to setup an HA domain by running two set of sequencers, mediators and domain-managers. Each side contains one sequencer, one mediator and one domain-manager. Also the mediators and domain managers share the same database connection with sequencers. I got the following errors when I start one side.

ERROR c.d.c.CantonEnterpriseApp$ - CONFIG_VALIDATION_ERROR(8,0): Failed to validate the configuration due to: Nodes manager domain,sequencer sequencer,mediator mediator share same DB access: DbAccess(postgresql://localhost:5432/domain?, Some(domain)) err-context:{causes=List(Nodes manager domain,sequencer sequencer,mediator mediator share same DB access: DbAccess(postgresql://localhost:5432/domain?, Some(domain))), location=CantonConfig.scala:1441}
ERROR c.d.c.CantonEnterpriseApp$ - An error occurred after parsing a config file that was obtained by merging multiple config files. The resulting merged-together config file, for which the error occurred, was written to ‘/tmp/canton-config-error-13412880661791522620.conf’.

Is it required to use different databases? Is there an easier way to configure HA domain without splitting the sequencer, mediator and domain-manager?

Hi @Frankie,

Yes you need to use a different database between your domain, mediator and sequencer nodes. That means that for a pair of each, you need 3 databases, and configure each pair to use the same one. You should also enable replication for all your nodes in your configuration file, but depending on your canton version that may be also enabled by default. You can find an easy to follow example in the distribution of canton-enterprise at examples/e04-high-availability.

Kind Regards,

1 Like

Thanks @Mate_Varga. It works with three databases setup and bootstrap them is easy. Is there a way to bootstrap HA sequencers and mediators from domain manager? Like the one in

@ domainManager1.setup.bootstrap_domain 
def bootstrap_domain(sequencers: Seq[com.digitalasset.canton.console.SequencerNodeReference], mediators: Seq[com.digitalasset.canton.console.MediatorReference]): Unit

1 Like

You can use the same, if you can have a remote console connection to all nodes that you want involve in the domain. The relevant docs page is this one:
NB: some of the commands are not available in the console when you use remote console references of your nodes.
You can also find example on how to use the remote console to bootstrap your domain in the examples folder of the canton-enterprise archive distribution as examples/e04-high-availability/admin

If you cannot get a direct connection to all your nodes in a single remote console instance, you can follow the guide at Manage Domain Entities — Daml SDK 2.5.5 documentation