-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arm32 dockerfile (using template) #76
base: master
Are you sure you want to change the base?
Conversation
…or requested type (int).: 75
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. |
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:
|
@@ -9,7 +9,7 @@ innodb_lock_schedule_algorithm=FCFS | |||
|
|||
# Subsequent `wsrep_provider_options` will replace the ones specified below | |||
wsrep_provider=/usr/lib/galera/libgalera_smm.so | |||
wsrep_provider_options="gcache.size=2048M; gcache.keep_pages_size=1024M; gcache.recover=yes;" | |||
wsrep_provider_options="gcache.size=128M; gcache.keep_pages_size=1024M; gcache.recover=yes;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also fork this file for amd64 vs armv6 because 128M is quite small for a machine without tiny disks so I'd like to keep the default for amd64 the same.
…rpi with sdcard) to startup
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) |
@@ -355,5 +355,5 @@ fi | |||
# Start mysqld | |||
echo "${LOG_MESSAGE} ---------------------------------------------------------------" | |||
echo "${LOG_MESSAGE} Starting with options: $OPT $START" | |||
exec mysqld $OPT $START | |||
exec mysqld $OPT $START --bind-address=0.0.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this is needed, but I think it belongs in one of the .cnf files instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already here: https://github.com/colinmollenhour/mariadb-galera-swarm/blob/master/conf.d/30-galera.cnf#L2
Are you overwriting this file locally, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue I guess is that, at least in the jsurf image and linuxserver image, the bind-address setting gets overwritten by /etc/mysql/mariadb.conf.d/50-server.cnf file, with 127.0.0.1.
The breakdown:
mysqladmin --help
command lists the following files
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
Out of those, only the /etc/mysql/my.cnf
file exists, with the following ending:
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
The first directory is the one the dockerfile populates, the second is presumably mariadb default.
Grepping for the bind-address yields the following output:
root@5d24286d9f20:/etc/mysql# grep -r "bind-address"
conf.d/30-galera.cnf:bind-address=0.0.0.0
mariadb.conf.d/50-server.cnf:bind-address = 127.0.0.1
As the /etc/mysql/mariadb.conf.d/
gets included later, I believe it overwrites the /etc/mysql/conf.d/
settings.
I guess we should then overwrite the mariadb.conf.d/50-server.cnf
through the dockerfile instead of my command argument solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'd like to avoid making major changes to the config to avoid impacting existing users, so probably just resetting the environment from the jsurf image to match that of the official image would be the best soluition. E.g. RUN rm /etc/mysql/conf.d/*
or similar.
@@ -423,4 +423,5 @@ test -s /var/run/galera-healthcheck-1.pid && kill $(cat /var/run/galera-healthch | |||
test -s /var/run/galera-healthcheck-2.pid && kill $(cat /var/run/galera-healthcheck-2.pid) | |||
|
|||
echo "Goodbye" | |||
cat /var/log/mysql/error.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused as to why this is needed since it is supposed to be set up so that errors go to stderr which is of course captured by docker... Is there a local cnf file overriding the log path perhaps?
I think this would be really confusing to see the full log after the "Goodbye" since it would not be chronologically correct, so if this does need to remain for some reason every line should be prefixed with something like: "=== post-shutdown - error.log:" so it is obvious where it is coming from. E.g. replace "cat" with:
awk -v prefix="=== post-shutdown - error.log: " '{print prefix $0}'
Any update on this? Need to Run MariaDB on a 5x Raspberry Pi 4 Cluster Would I just pull the master from DockerHub |
Hi all, would love to see this pull requested being merged. Thx |
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! |
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.