-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix initialization of mysqld #6
Conversation
a321317
to
d19084c
Compare
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.
lgtm - left a minor comment, check if make sense
ln -sf /root/parts/packages-deb/install/usr/lib/x86_64-linux-gnu/libaio.so.1 /usr/lib/x86_64-linux-gnu/libaio.so.1 | ||
rm -rf /var/lib/mysql/ | ||
mysqld --initialize | ||
cp -r /var/lib/mysql $CRAFT_STAGE/var/lib |
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.
does it make sense to use cp -ar
here so it will preserve ownership (and avoid next line)
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 don't believe that works because at the time of creation, the mysql
user does not exist and so ownership has to be set to a user id which will eventually be the id for the mysql
user that is created later.
I could be wrong about that, but from my understanding, that would be an issue.
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.
Just a note: we were able to manually test the ROCK with mysql-k8s-operator (successfully deploying and scaling it)
Issue
mysql was not initialized correctly
Solution
mysql is initialized with a startup script that creates the necessary folders and sets permissions
Context
Testing
Built, ran locally with docker. Need to throw the image in the associated charm for further testing.
Release Notes
Added initialization script
Created missing default directories
Set permissions for the mysql user