Replacement of the internal H2 database possible?

Hi. We are using the standard edition of Axon Server in a small customer project. The software is running on a AWS cloud. Now the customer “switches clusters”, as they call it. We store ‘data’ and ‘eventdata’ in a EFS. Now it seems that one “cluster” is still running while the other starts up, so the second instance of Axon Server fails of course, because the internal H2 database is still locked.

I assume using the enterprise version would be a solution for this scenario, but this is out of question because of the budget.

My question is: Is it possible to use f.e. PostgresQL instead of the internal H2 database? I could not find documentation on that topic. And would this solve the problem?

Thanks & cheers,

Hi Erik,
as you said the enterprise version is the solution if you need cluster that guarantee redundancy, fault tolerance and high availability.
I don’t understand what are you trying to achieve : a version update with zero-downtime maybe?

The controldb saved into h2 database contains vital information for the Axon Server node and Cluster. Therefore share it with other instance does not solve your issue and most likely will generate few more.
Said so, it is also not possible to replace H2 database in favor of another sql-like database.

As you did for events and data, I suggest you to store controldb in a persisted volume, assigned to the AS node instance : you can configure where controldb is stored on the instance setting up the property axoniq.axonserver.controldb-path in your axon server config.
The correct way to replace an instance, in case you want to perform a version upgrade for example, is to shut down safely axonserver process, replace the jar axonserver jar file and cli, and restart the instance. Once started up again the instance will perform internal updates operation, then rejoin the cluster, receive the updates from other nodes and be eligible to be elected leader for replication groups.

You can read more about the topic searching in our blog : for example this article Running Axon Server in Docker is a good way to start.

EDIT: noticed just after I post the reply that you are using AxonServer Standard Edition. I was confused by the word “cluster”. What I said applies for the Enterprise Edition.