I have set up an cluster with ocfs2 on top of drbd in primary/primary mode. As long as the datadir is in /var/lib/mysql, everything works fine. But as soon as I put the datadir on the ocfs2 filesystem /mnt/data/mysql mysql fails with: [Ubuntu] root at fs2:/etc# mysqld --safe-mode 090930 18:08:14 [Warning] Can't create test file /mnt/data/mysql/fs2.lower-test 090930 18:08:14 [Warning] Can't create test file /mnt/data/mysql/fs2.lower-test 090930 18:08:14 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. InnoDB: File name ./ibdata1 InnoDB: File operation call: 'open'. InnoDB: Cannot continue operation. When I temporarily login as user mysql and create the same file it can create the file: $ whoami mysql $ echo a >/mnt/data/mysql/fs2.lower-test $ ls -al -rw-r--r-- 1 mysql mysql 2 2009-09-30 19:15 fs2.lower-test I've also tried with an ext3 filesystem on the drbd device in primary/secondary configuration, this worked fine. So this only happens when the datadir is on a ocfs2 file system. Some more facts: - still the same error if filesystem is unmounted on the other machine of the cluster - O2CB_HEARTBEAT_THRESHOLD=31 - Ubuntu 8.043 - MySQL server is mysql-server 5.0.51a - ocfs2-tools 1.3.9 - drbd8-utils 2:8.0.11-0 Has anybody experienced a similar problem? May it have to do with locking or extended attributes? I've also asked on the Mysql users side as I do not know whether this is an OCFS or a MySQL problem. Best regards Peter
You can try trapping the error in the fs. Do: # debugfs.ocfs2 -l NAMEI ENTRY on # mysqld --safe-node # debugfs.ocfs2 -l NAMEI off ENTRY deny /var/log/messages will have the logs. Peter P GMX wrote:> I have set up an cluster with ocfs2 on top of drbd in primary/primary mode. > As long as the datadir is in /var/lib/mysql, everything works fine. > But as soon as I put the datadir on the ocfs2 filesystem > /mnt/data/mysql > mysql fails with: > [Ubuntu] root at fs2:/etc# mysqld --safe-mode > 090930 18:08:14 [Warning] Can't create test file > /mnt/data/mysql/fs2.lower-test > 090930 18:08:14 [Warning] Can't create test file > /mnt/data/mysql/fs2.lower-test > 090930 18:08:14 InnoDB: Operating system error number 13 in a file > operation. > InnoDB: The error means mysqld does not have the access rights to > InnoDB: the directory. > InnoDB: File name ./ibdata1 > InnoDB: File operation call: 'open'. > InnoDB: Cannot continue operation. > > When I temporarily login as user mysql and create the same file it can > create the file: > $ whoami > mysql > $ echo a >/mnt/data/mysql/fs2.lower-test > $ ls -al > -rw-r--r-- 1 mysql mysql 2 2009-09-30 19:15 fs2.lower-test > > I've also tried with an ext3 filesystem on the drbd device in > primary/secondary configuration, this worked fine. > So this only happens when the datadir is on a ocfs2 file system. > > Some more facts: > - still the same error if filesystem is unmounted on the other machine > of the cluster > - O2CB_HEARTBEAT_THRESHOLD=31 > - Ubuntu 8.043 > - MySQL server is mysql-server 5.0.51a > - ocfs2-tools 1.3.9 > - drbd8-utils 2:8.0.11-0 > > Has anybody experienced a similar problem? May it have to do with > locking or extended attributes? > I've also asked on the Mysql users side as I do not know whether this is > an OCFS or a MySQL problem. > > Best regards > Peter > > _______________________________________________ > Ocfs2-users mailing list > Ocfs2-users at oss.oracle.com > http://oss.oracle.com/mailman/listinfo/ocfs2-users >
Hello Sunil, thanks for the hints about xattr and security. It is solved now. The reason was, that apparmor was running with a restricted mysqld profile. /etc/apparmor.d/usr.sbin.mysqld For those who read the mailing list: $ apparmor_status apparmor module is loaded. 1 profiles are loaded. 1 profiles are in enforce mode. /usr/sbin/mysqld 0 profiles are in compl Mysqld was in enforced mode which means that access was prohibited to the newly created directories on hte ocfs2 share. Turning off apparmor by init script made mysql running. So I enhanced the apparmor profile /etc/apparmor.d/usr.sbin.mysqld and added the direcories I had on the ocsfs share. Now it works with apparmor running. Thank you for your support and best regards Peter Sunil Mushran schrieb:> So it does not look like the EACCES is being returned by ocfs2. > It could be generic vfs. But then it could be you have some security > enabled that expects the fs to support xattr. If that is the case, you > will have to upgrade to a more recent kernel. 2.6.30. > > Peter P GMX wrote: >> Hello Sunil, >> >> thank you for your support. Here is a new log with EXIT. >> >> Best regards >> Peter >> >> Sunil Mushran schrieb: >> >>> It did not catch the error. Maybe enable EXIT traces too. >>> This time attach the log. Hard to read the cut-paste. >>> >>> >