How to Use OSTicket Docker Image with a Galera Cluster

126 Views Asked by At

I've been taksed to convert our standalone DB server that runs the OSTicket database into a MariaDB Galera cluster to add a level of resiliency to the service, I've got the cluster and have set the MYSQL_HOST variable to one of the nodes which works fine, however I am unable to set it to 'speak' to the whole cluster so currently it's not really doing the job required.

We have a haproxy docker instance we call swarm-maria which does other bits for our application which we have tried to point OSTicket to use (swamr-maria_proxy in the MYSQL_HOST variable) on an unused port but no dice, we then tried to add a 'link' as mentioned in the docker page for OSTicket (swarm-maria_proxy:mysql) and comment out the MYSQL_HOST variable but then it has a problem that it doesn't have said variable...

Are there any 'standard practice' ways of doing this?

1

There are 1 best solutions below

0
RogerPontare On

Set a ha-proxy in tcp mode as the "MySQL" server with a static ip. Set that ip as MySQL host in OsTicket.

Configure ha-cluster to use all MySQL backend-nodes they way you want.

That is probably the best way to go. You can also take a MySQL-node down from the Galera cluster if it need some maintenance and the system will be online.

Remember: when you take a MySQL-node down and start it again then Galera will set another MySQL-node down as it syncs data (2 nodes will be down). In the Galera config you can specify what node it would use as sync-node. If you have 4 servers let 1 be the sync-node and specify that as sync-node in the other 3. If the sync-node goes down it will bring a random node down when syncing itself. You could also specify what node it should use permanent for sync when it happens.