We're setting up both master and slave servers. We're overriding the tmpfile location to a volume with more storage. The slave is failing to access that storage because apparmor is not granting proper access to it.
:pancakes: Cookbook version
8.5.2
:woman_cook: Chef-Infra Version
13.12.14
:tophat: Platform details
Ubuntu 16.04
MySQL 5.7
Steps To Reproduce
Set up master and slave servers both overriding tmp_dir:
mysql_service 'companyname' do
...
tmp_dir "/mnt/vol1/tmp"
...
end
Last_SQL_Error: Unable to use slave's temporary directory /mnt/vol1/tmp - Can't read dir of '/mnt/vol1/tmp/' (Errcode: 13 - Permission denied)
:heavy_plus_sign: Additional context
The root cause is that apparmor configuration grants permissions to all files in the tmp dir, but not the tmp dir itself. MySQL checks for access to the directory and fails.
/etc/apparmor.d/local/mysql/instancename looks like:
:ghost: Brief Description
We're setting up both master and slave servers. We're overriding the tmpfile location to a volume with more storage. The slave is failing to access that storage because apparmor is not granting proper access to it.
:pancakes: Cookbook version
8.5.2
:woman_cook: Chef-Infra Version
13.12.14
:tophat: Platform details
Ubuntu 16.04 MySQL 5.7
Steps To Reproduce
:police_car: Expected behavior:
Slave should be successfully replicating
:bug: Actual behavior:
Replication fails with error:
:heavy_plus_sign: Additional context
The root cause is that apparmor configuration grants permissions to all files in the tmp dir, but not the tmp dir itself. MySQL checks for access to the directory and fails.
/etc/apparmor.d/local/mysql/instancename
looks like:Needs to add a line like