I have followed the instructions here to set up a Galera cluster. The instruction says I need to disable appArmor:
Disabling AppArmor
By default, some servers—for instance, Ubuntu—include AppArmor, which may prevent mysqld from opening additional ports or running scripts. You must disable AppArmor or configure it to allow mysqld...
So I followed the instructions and executed, the following commands:
sudo ln -s /etc/apparmor.d/usr /etc/apparmor.d/disable/.sbin.mysqld
sudo service apparmor restart
I have completed the cluster configuration. But I am not sure if I have correctly disabled the AppArmor, because when I run:
sudo aa-status
I get:
... some more output here
2 processes have profiles defined.
1 processes are in enforce mode.
/usr/sbin/mysqld (1938)
1 processes are in complain mode.
snap.amazon-ssm-agent.amazon-ssm-agent (1295)
0 processes are unconfined but have a profile defined.
I see mysqld is in enforce mode... what does this mean? Does it mean AppArmor is disabled for MySQL? Is it possible to disable AppArmor all together?
"What does it mean?"; It means restrictions for the AppArmor profile for mysql will be enforced.
"Can it be disabled"; yes it can, how:
Example:
Then run the command
sudo aa-status
to see if the mysql profile is loaded.To re-enable:
See:
https://www.cyberciti.biz/faq/ubuntu-linux-howto-disable-apparmor-commands/
https://wiki.ubuntu.com/AppArmor
https://help.ubuntu.com/community/AppArmor
If you're getting an error in 20.04 when storing a password in a keychain, that's AppArmor securing snap applications.
You can fix this by clicking "Permissions" in Ubuntu Software when viewing the MySQL Workbench app. Turn on the reading/writing passwords permission.