3

I am setting up a backup server for an already existing Ubuntu server setup.

I'm running DRBD (protocol C) together with heartbeat, which is configured so that in case of an error the MySQL5 Server on the backup server starts.

I want to start the mysql server after replication using drbd and heartbeat.

I changed the datadir in my.cnf file and in apparmor.d/usr.bin.mysqld also.

Mysql starts when drbd device is not mounted.

My logs shows as follows:

Oct 26 12:55:28 twyford-hambc2 mysqld[27627]: 101026 12:55:28 InnoDB: Operating system error number 13 in a file operation.
Oct 26 12:55:28 twyford-hambc2 mysqld[27627]: InnoDB: The error means mysqld does not have the access rights to
Oct 26 12:55:28 twyford-hambc2 mysqld[27627]: InnoDB: the directory.
Oct 26 12:55:28 twyford-hambc2 mysqld[27627]: InnoDB: File name ./ibdata1
Oct 26 12:55:28 twyford-hambc2 mysqld[27627]: InnoDB: File operation call: 'open'.
Oct 26 12:55:28 twyford-hambc2 mysqld[27627]: InnoDB: Cannot continue operation.
Oct 26 12:55:28 twyford-hambc2 mysqld_safe[27634]: ended

Oct 26 12:55:42 twyford-hambc2 kernel: [ 2876.791880] type=1503 audit(1288094142.991:53: operation="inode_permission" requested_mask="::r" denied_mask="::r" fsuid=0 $
Oct 26 12:55:42 twyford-hambc2 /etc/init.d/mysql[27799]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Oct 26 12:55:42 twyford-hambc2 /etc/init.d/mysql[27799]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Oct 26 12:55:42 twyford-hambc2 /etc/init.d/mysql[27799]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Oct 26 12:55:42 twyford-hambc2 /etc/init.d/mysql[27799]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Oct 26 12:55:42 twyford-hambc2 /etc/init.d/mysql[27799]:
Oct 26 12:56:46 twyford-hambc2 lrmd: [17345]: WARN: mysql:start process (PID 2732 timed out (try 1). Killing with signal SIGTERM (15).
Oct 26 12:56:46 twyford-hambc2 lrmd: [17345]: WARN: operation start[139] on ocf::mysql::mysql for client 17348, its parameters: socket=[/var/run/mysqld/mysqld.sock] bi$

Any help appreciated.

Coops
  • 6,055
  • 1
  • 34
  • 54

3 Answers3

1

The question is poorly written and confusing to understand what the actual symptoms are.

When using heartbeat to stop/start processes, it is important to also go through and change the default services. MySQL should not start on server boot. The DRBD should not on boot. These actions should be controlled by heartbeat and not normal /etc/rc?.d init scripts.

To troubleshoot further, add some up/down scripts in heartbeat to log what the system is doing when switching between master and backup states.

Wim Kerkhoff
  • 901
  • 1
  • 5
  • 12
0

I would suggest using MySQL replication instead of drbd.

With this setup you had 2 libe MySQL servers and heartbeat would only need to switch the service ips and possible other stuff...

Using drbd for the database backend is known to produce corrupted databases.

Silent-Bob
  • 1,066
  • 6
  • 9
-1

I guess, your first thing to do is to disable the selinux.
Disable selinux, reboot and check the logs again.

Later edit: Mysql service start under mysql user account. Check file permissions for the mysql files to be owned by mysql user.

Paul
  • 1,857
  • 1
  • 11
  • 15
  • Ubuntu doesn't run SELinux, it uses Apparmor, which he says he's amended the configuration for. – Coops Mar 03 '11 at 12:19