Comments - MariaDB troubles, only running after reboot, times out when trying restart, not stable when running.

 
5 years, 7 months ago Michael Rupp

Somebody at the MariaDB foundation needs to get the people at AppArmor to get their shizzle straight. I disabled AppArmor on boot and rebooted my server and MariaDB worked perfectly. I looked for better ways to configure usr.sbin.mysqld in /usr/lib/x86_64-linux-gnu/mariadb18/plugin/ to make AppArmor stop killing the socket '/var/run/mysqld/mysqld.sock' socket, but found none.

As of this writing, I reinstated the AppArmor's start on boot status, then rebooted the server and MariaDB is still running after about 3 hours.

It seems the best way to switch from MySQL to MariaDB on Ubuntu 18.04 LTS server is to turn off AppArmor, then install the MariaDB:

sudo systemctl stop apparmor.service
sudo update-rc.d -f apparmor remove

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mariadb-server

sudo systemctl start apparmor.service
sudo update-rc.d apparmor defaults
 
5 years, 7 months ago Faustin Lammler

Hi, thank you for your report.

Regarding upgrading from mysql-5.7, the recommended way is to: - backup your database first (https://mariadb.com/kb/en/library/backup-and-restore-overview/); - during the upgrade, you will be warned if the database was not migrated to mariadb, then you should import the backup into the new database (see previous link).

If you did not have a backup, then please look at this https://jira.mariadb.org/browse/MDEV-11170 that explain how to reinstall mysql-5.7 and do the backup.

Regarding apparmor, we do not provide a profile for apparmor (it is commented), so the best thing to do is to remove any old apparmor profile that was deployed with mysql-5.7.

And finally, your log file is way to big, it is useless to paste so much lines of code and it make this KB question unreadable for other users. Only paste the lines that are significant (for instance, it is not necessary to paste two identical error logs.)

Please let me know if you need more help on this, I will be happy to help you.

More on apparmor can be found here: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865534 https://jira.mariadb.org/browse/MDEV-3519?jql=text%20~%20%22apparmor%22

Regards, Faustin

 
5 years, 7 months ago Michael Rupp

Thank you for replying without reading it. I found it helpful to be told how to do something I already did.

Also, thanks for telling me about AppArmor without looking into it after I already solved my own problem. AppArmor will be pleased to know that their MySQL profile that blocks nothing and is geared to work for MariaDB without any alterations doesn't exist.

Also, also, perhaps you can enlighten me on how a person with a technical problem could know beforehand what part of the log is "significant" to the problem? If we knew what part was significant, we could probably have solved our own problem before posting a question. Shouldn't you know how to Ctrl-F or scan the log for significant keywords so as to diagnose the problem?

Also, also, also, thanks for adding irrelevant links to workarounds that are either more complicated or less safe than the one I posted as a solution to my own problem. That wasn't a waste of my time to read them. Good on you though for throwing the noodle against the wall to see if it sticks.

Do you want to tell me now how your primary and unique keys don't work on CHAR fields bigger than 191 but MySQL did on 255 sized fields and importing the backup from one to the other is a shit-show?

 
5 years, 7 months ago Faustin Lammler

Hi Michael, sorry and yes I did not read well your answer that is a good workaround (but see bellow).

Disabling completely apparmor to install mariadb is not satisfactory from a security point of view (other program or services could be impacted) so we can not validate this answer fully.

And in my (too fast) response, I have put this link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865534

Where I explain a solution to disable only the problematic apparmor profile:

$ sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld 

Verify:

$ sudo aa-status

Finalize mariadb-server upgrade:

$ sudo dpkg --configure mariadb-server

Regards, Faustin

 
5 years, 7 months ago Michael Rupp

I did not disable AppArmor. I paused it for the install of MariaDB then turned it back on again after the install.

AppArmor is holding some signature to Identify MySQL and it's erroneously keeping it alive when MariaDB is installed. Pausing it and restarting it after the install allowed it to drop the old reference and recognize MariaDB as the valid program for MySQL commands.

 
5 years, 6 months ago Faustin Lammler

Hi Michael,

thank you for this, I will compile an answer based on your solution and mine.

Let me know if you feel I am missing something.

Faustin

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.