I was dissecting my possibility of running a MariaDB Galera cluster within OpenShift a few days ago, but I got stuck on a few things I was hoping someone could help me with:
- Is there a way to have an environment variable of some sort which could list all the gears running? I would like to create the whole cartridge similar to a web-app style so that it can scale infinitely. From what I understand, environment variables set are global across all the gears upon first run, but does that mean they can be dynamically updated? I need this to write some logic to prevent a split brain. This is because the cluster requires the first "gear" to be brought up with the slightly different command.
- Is it possible to use the haproxy routing to loadbalance the requests to the cluster? I'm not so familiar with haproxy, but I'm assuming as it can run like a tcp loadbalancer similar to LVS (which I currently use for my external cluster) I don't see why it couldn't work. It'd obviously need a custom port?
- I think I read somewhere, that by default the gears will try to do negative affinity by default when scaling out? eg. be hosted on a separate node. Is that the default behavior, or am I thinking of something else?
- Am I wrong to assume this won't work with Online as it requires some external dependencies from the MariaDB repo (not SCL)?
Any suggestions would be much appreciated.