Closed kklepper closed 5 years ago
Hello, great work indeed!
Thanks!
Changing from
RUN apk add --no-cache mariadb=10.3.15-r0
toRUN apk add --no-cache mariadb
yields ...
The linter (hadolint) doesn't like implicit versioning. I need to bump version, is all.
Most important for me is error 1 as I heavily use sphinx search.
One goal with this container is that I optimized for size, meaning I removed a lot of plugins. Let me have a look at this specific case and perhaps re-add it (the balance I'm trying to find is to heavily optimize for size/bootup but not cripple a developer experience)!
Found out...
1:
ALTER TABLE mysql.
eventCHANGE
sql_mode`sql_mode
SET('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';`
2:
remove * in .dockerignore
Now COPY ha_sphinx.so /usr/lib/mariadb/plugin
works.
BTW, the ha_sphinx.so
files I found had extremely different sizes. The right size for me is
docker@boot2docker:/c/kklepper/test/mariadb2$ ls -latr ha_sphinx.so
-rwxr-xr-x 1 docker staff 96320 Oct 2 19:12 ha_sphinx.so
I picked it from a working container based on alpine 3.3.
Now I need to integrate this into my stack... This container keeps quitting after some minutes.
docker@boot2docker:/c/kklepper/voxx/vx$ docker ps -a | grep "db2:"
239ca11b115f kklepper/mariadb2:alpine "/start-v2.sh" 24 seconds ago Up 18 seconds 3306/tcp vx_master.1.kj33vmuv4edlsrkr73ro5hy1c
9458327dfdd7 kklepper/mariadb2:alpine "/start-v2.sh" About a minute ago Exited (1) 26 seconds ago vx_master.1.o2o8uq7cbagsasetyrbigu2co
I'll find out, too.
If you don't mind, I'll repoen this and have a look at fixing sphinx!
So, I had a look at this. Sphinx actually looks like its available as a separate package, but it has additional dependencies on top of mariadb which doubles the size of the container. I'm thinking this is wandering a bit too far off from the goals of this specific project:
~ # apk add sphinx
(1/9) Installing expat (2.2.8-r0)
(2/9) Installing mariadb-connector-c (3.0.10-r0)
(3/9) Installing readline (8.0.0-r0)
(4/9) Installing unixodbc (2.3.7-r1)
(5/9) Installing db (5.3.28-r1)
(6/9) Installing libsasl (2.1.27-r3)
(7/9) Installing libldap (2.4.48-r0)
(8/9) Installing libpq (11.5-r1)
(9/9) Installing sphinx (2.2.11-r1)
For your use case, perhaps check if apk add mariadb sphinx
works fine?
This is my solution:
a. based on
jbergstroem/mariadb-alpine 3 months ago 38.1MB
kklepper/mariadb(unchanged) 28 hours ago 38.2MB
kklepper/mariadb2(client) About an hour ago 79.2MB
b. switched to alpine 3.3 which has ha_sphinx.so and no problems with mysql.event:
kklepper/mariadb33 16 minutes ago 90.1MB
kklepper/mariadb33(client) 3 minutes ago 112MB
My previous solution based on alpine 3.3 (client):
kklepper/mariadb-10.1-ms-mha.33 25 hours ago 217MB
Hello, great work indeed!
But I can't reproduce:
Changing from
RUN apk add --no-cache mariadb=10.3.15-r0 \
to
RUN apk add --no-cache mariadb \
yields
So that's what we want.
Adding mariadb-client increases the size considerably (kklepper/mariadb2 ):
Ok as well.
Running either version reveals errors:
I cannot fix any of these.
I tried to fix the second with what is given on https://support.plesk.com/hc/en-us/articles/360004067893-Error-in-MySQL-log-files-Incorrect-definition-of-table-mysql-event-expected-column-sql-mode-at-position-14 to no avail. https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-11.html might give a hint, though.
I find https://dba.stackexchange.com/questions/56267/incorrect-definition-of-table-mysql-event-after-migrating-database-to-mariadb
but cannot make sense of it.
Most important for me is error 1 as I heavily use sphinx search.
alpine 3.3 has
/usr/lib/mysql/plugin/ha_sphinx.so
, https://pkgs.alpinelinux.org/contents?branch=v3.3&name=mariadb&arch=x86&repo=main, the newer versions don't. The reason maybe is found in https://mariadb.com/kb/en/library/documentation/columns-storage-engines-and-plugins/storage-engines/tokudb/tokudb-engine-installation-problem/ where it statesGLIBC isn't for alpine...
But 3.3 produces a new error:
So I got
ha_sphinx.so
from somewhere. AddingCOPY files/ha_sphinx.so /usr/lib/mariadb/plugin
produces a strange errorStep 7/12 : COPY files/ha_sphinx.so /usr/lib/mariadb/plugin COPY failed: stat /mnt/sda1/var/lib/docker/tmp/docker-builder670482555/files/ha_sphinx.so: no such file or directory
while
Even adding
RUN ls -altrh /c/kklepper/test/mariadb2/files/ha_sphinx.so
showsI'm stuck. Any idea?