我在 Ubuntu 10.04 服务器上运行 MySQL,MySQL $datadir 位于 iSCSI 卷上。文件系统在/etc/fstab
. 在系统关闭时,upstart 向 MySQL 发送一个 SIGTERM,然后继续关闭网络接口,无需等待 MySQL 退出或 iSCSI 磁盘被卸载或断开连接。当然,这会导致 XFS 无法完全卸载,并且 MySQL 需要在启动时花几分钟时间重播 InnoDB 日志。
我不清楚在正确的地方开始戳来解决这个问题。根据我的阅读,upstart 应该已经足够聪明,可以在关闭网络接口之前等待 iSCSI 文件系统卸载和断开连接,尽管这并没有发生。而且我不知道如何告诉它它还需要等待 MySQL 的完全关闭。
这是控制台在关机过程中显示的内容:
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