piwik

dimecres, 5 de juny del 2013

How to avoid apparmor errors when running multiple mysql instances

When Apparmor complains about deny access to some directory, like in this case with mysql data paths and mysql.sock, we'll have to add those paths to the apparmor config file for mysql.

root@server10124:~# vi /etc/apparmor.d/usr.sbin.mysqld
  /var/run/mysqld/mysqld.pid w,
  /var/run/mysqld/mysqld.sock w,
  /var/run/mysqld/mysqld1.pid w,
  /var/run/mysqld/mysqld1.sock w,
  /var/run/mysqld/mysqld2.pid w,
  /var/run/mysqld/mysqld2.sock w,
  /run/mysqld/mysqld.pid w,
  /run/mysqld/mysqld.sock w,
  /run/mysqld/mysqld1.pid w,
  /run/mysqld/mysqld1.sock w,
  /run/mysqld/mysqld2.pid w,
  /run/mysqld/mysqld2.sock w,
  /home/replic_dbmaster/** rwk,
  /home/replic_dbmaster/ r,
  /home/replic_dbslave/** rwk,
  /home/replic_dbslave/ r,

Then, all we have to do is reload Apparmor and start up mysql instances.

root@server10124:~# service apparmor restart

Cap comentari:

Publica un comentari a l'entrada