colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
219 stars 103 forks source link

Arm32 dockerfile (using template) #76

Open cvb941 opened 5 years ago

cvb941 commented 5 years ago

I deleted the dockerfiles and created a script build.sh which creates them using a template dockerfile, for each combination of (architecture x mariadb_version). The final dockerfile then uses a suitable image and correct dependent binaries (which I made and added for arm32).

Although it is rather unclean now, since for the arm32 I used a mariadb image for raspberry from jsurf, which has only the 10.1 mariadb version, so at this moment I skip 10.2 and 10.3. We should probably wait for a more complete solution, that could use this as a base for the change. A solution would certainly be to use a different docker image than the official mariadb one. There is one from bitnami, linuxserver or this one which uses alpine linux (and thus apk instead of apt).

I also lowered the value of gcache to 128MB, since the 2048MB value crashed on raspberry (this bug).

What is left to be done is creating a manifest from these generated dockerfiles and we can have proper multiarch images.

cvb941 commented 5 years ago

I might have been successful in using the linuxserver mariadb base image, but I cannot test it right now since my raspberry sd card got corrupted. I'm ordering a new one and will post an update here once I try it out.

colinmollenhour commented 5 years ago

Looking good. I think I'd like to keep the Dockerfiles though, so perhaps rather than delete them just add a notice at the top like:

# DO NOT EDIT THIS FILE - See Dockerfile.template
cvb941 commented 5 years ago

All right, I have managed to make the linuxserver base image work. It should be better compared to jsurfs image, has working xtrabackup-v2 and resolves correctly on armv6 docker (jsurf's required --resolve-image=never to run). Although it required an additional chown on another mysql folder and apt install of gosu package.

While I wanted to use a different image compared to jsurf's because of mariadb versions other than 10.1, while linuxserver looks like it has images tagged with 10.3 version of mariadb, the arm version of the image seems to include the 10.1 anyway. So for now, still only 10.1 image for armv6 (10.1.40 to be precise).

@colinmollenhour I have also included a --bind-address=0.0.0.0 argument on the mysqld command, without which I wasn't able to connect to my cluster from outside (not even the healthcheck would connect and the container would get killed) I have too prolonged the healthcheck in the dockerfile, this was driving me crazy, since on my second, older raspberry, the containers didn't fully start up or did only sometimes. After tearing some hair I finally found out that the swarm was killing the containers because the poor SD card couldn't start them fast enough. Raising the healthcheck retries appear to solve that. Also I have a line at the end of start.sh where I printed out the mysql error log, which helped me a lot in my journey of debugging the containers. Please comment on those changes and I can update them to your liking, or remove them if you want.

mozzhead164 commented 4 years ago

Any update on this? Need to Run MariaDB on a 5x Raspberry Pi 4 Cluster

Would I just pull the master from DockerHub ie $docker pull colinmollenhour/mariadb-galera-swarm:10.1.43-2020-01-06

NightDragon1 commented 3 years ago

Hi all,

would love to see this pull requested being merged. Already hungry for a raspi-galera swarm solution :)

Thx

colinmollenhour commented 2 years ago

Hi all, thanks for the contributions and interest. I don't have a test platform setup for Arm32 or a reason to use it so will need others to test it. There are a few unresolved issues noted in the PR which need to be addressed and now there are also many new versions supported so I am simply waiting for someone else to finish this PR. Thanks!