On Feb 25, 2014, at 4:48 AM, Andrew Lau <andrew andrewklau com> wrote:
Hi guys,I've been working on bringing MariaDB Galera  to OpenShift and so far I've quite successful with the help from many different people. I'm stuck on a few things though which I'm hoping someone could help me with.- Determining a master gear for the database initializationWith the galera cluster, we need to have one gear create the database, drop test user. etc. all the normal stuff, however only one needs to do this. The problem is, starting the cartridge with min 3 gears, they will all race to start, this makes using a hook method not possible because there'll be too many inconsistencies. I'd ideally not want to be creating two separate cartridges just for this.On your initial connection hook call you can sort the recieved ids and store an env var marking that id as your "elected" master. Then to reelect just delete that env and restart.
So far the only option I can think of is starting the cartridge as one gear, and then adding the others after. But I'd ideally like to reduce the amount of work the user needs to do to get this up and running.If anyone wants to take it for a spin, you'll need to put it behind a scaled web cartridge (eg. php). Right now you'll end up with X instances of mariadb in separate gears.- Is telnet safe to useI know with all recent OS installs, telnet is not bundled as a pre-installed package, and neither is nc. However openshift online nodes seem to have telnet accessible. Right now, I'm just using it to do inte-gear testing. ie. before we start the cluster, let's check which hosts are online so we don't try connect to a dead host. Any help would be much appreciated!Thanks,