在Ubuntu Lucid上正确地命令closuresMySQL和iSCSI

我在Ubuntu 10.04服务器上运行MySQL,MySQL $ datadir位于iSCSI卷上。 文件系统在/etc/fstab标记为“_netdev”。 在系统closures时,upstart会向MySQL发送一个SIGTERM,然后继续closuresnetworking接口,而无需等待MySQL退出或者iSCSI磁盘被卸载或断开连接。 这当然会导致XFS无法正常卸载,MySQL需要花费几分钟的时间在启动时重播InnoDB日志。

我不清楚在正确的地方开始戳这个问题。 从我读到的,新贵应该已经足够聪明,等待iSCSI文件系统卸载和断开连接,然后closuresnetworking接口,虽然这没有发生。 我不知道如何告诉它,它也需要等待MySQL的干净closures。

这是控制台在关机过程中显示的内容:

 Broadcast message from root@mysql-a1 (unknown) at 11:19 ... The system is going down for halt NOW! Power button pressed * Stopping Bacula File daemon... [ OK ] Stopping file integrity checker: samhain. * Running nssldap-update-ignoreusers... [ OK ] * Stopping multipath daemon multipathd [ OK ] * Stopping nagios-nrpe nagios-nrpe [ OK ] * Stopping Name Service Cache Daemon nscd [ OK ] * Stopping Postfix Mail Transport Agent postfix [ OK ] * Stopping SSH throttling throttle-ssh [ OK ] * Stopping puppet agent [ OK ] * Stopping system logging syslog-ng [ OK ] Stopping statistics collection and monitoring daemon: collectdcollectd[1210]: Exiting normally. collectd[1210]: collectd: Stopping 15 read threads. collectdmon[1209]: Info: collectd terminated with exit status 0 collectdmon[1209]: Info: shutting down collectdmon . * Asking all remaining processes to terminate... [ OK ] * All processes ended within 1 seconds.... [ OK ] * Deconfiguring network interfaces... [ 2884.248199] end_request: I/O error, dev dm-0, sector 5216 [ 2884.249807] end_request: I/O error, dev dm-0, sector 4192 [ 2884.817855] end_request: I/O error, dev dm-0, sector 0 [ 2884.819347] XFS (dm-0): Device dm-0: metadata write error block 0x0 [ 2884.821281] XFS (dm-0): I/O Error Detected. Shutting down filesystem [ 2884.823393] XFS (dm-0): Please umount the filesystem and rectify the problem(s) [ 2885.367423] end_request: I/O error, dev dm-0, sector 0 init: mysql main process (4168) terminated with status 1 [ OK ] * Deactivating swap... [ OK ] * Unmounting weak filesystems... [ OK ] * Unmounting local filesystems... [ OK ] * Disconnecting iSCSI targets [ OK ] * Stopping iSCSI initiator service [ OK ] * Will now halt [ 2886.802324] Power down. Connection to bottom.cw closed. bottom:~ insyte$ 

这是fstab条目:

 /dev/mapper/21db3d79bf30ef4846c9ce90069680087 /srv/mysql xfs _netdev,noatime,nodev,noexec 0 0 

你有几个select:

  1. 升级到精确。 这个问题在那里得到解决。
  2. 改变停止条件(在/etc/init/mysql.conf中) stop on starting rc RUNLEVEL=[016]
  3. 进入任何初始化脚本(我很确定它是sysv)closuresnetworking接口,并添加命令initctl emit deconfiguring-networking接口被closures之前。 然后,改变停止的条件下的MySQL stop on deconfiguring-networking or runlevel [016]

中间选项可能是最简单的。