【问题标题】:MySQL / MariaDB shuts down after exactly 1 minute 42 secondsMySQL / MariaDB 在 1 分 42 秒后关闭
【发布时间】:2017-04-26 01:54:08
【问题描述】:

我已经通过 VirtualBox 和 Vagrant 在 macOS Sierra 上安装了 Homestead。一切正常,除了一些神秘的原因 MySQL 在盒子启动超过 1 分 42 秒后自行关闭......

我可以在前 1 分 42 秒内毫无问题地使用 MySQL,但随后服务突然关闭并拒绝进一步连接。

服务器启动后我tailed /var/log/syslog 出现以下系统日志条目:

Dec 10 20:02:25 homestead systemd[1]: mariadb.service: Start operation timed out. Terminating.
Dec 10 20:02:25 homestead mysqld[1611]: 2016-12-10 20:02:25 140574075632384 [Note] /usr/sbin/mysqld: Normal shutdown
Dec 10 20:02:25 homestead mysqld[1611]: 2016-12-10 20:02:25 140574075632384 [Note] Event Scheduler: Purging the queue. 0 events
Dec 10 20:02:25 homestead kernel: [  100.520787] audit_printk_skb: 15 callbacks suppressed
Dec 10 20:02:25 homestead kernel: [  100.520844] audit: type=1400 audit(1481400145.309:17): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=1611 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=113 ouid=0
Dec 10 20:02:25 homestead mysqld[1611]: 2016-12-10 20:02:25 140573193234176 [Note] InnoDB: FTS optimize thread exiting.
Dec 10 20:02:25 homestead mysqld[1611]: 2016-12-10 20:02:25 140574075632384 [Note] InnoDB: Starting shutdown...
Dec 10 20:02:25 homestead systemd[1]: Started Session 4 of user vagrant.
Dec 10 20:02:26 homestead mysqld[1611]: 2016-12-10 20:02:26 140574075632384 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
Dec 10 20:02:27 homestead mysqld[1611]: 2016-12-10 20:02:27 140574075632384 [Note] InnoDB: Shutdown completed; log sequence number 1355249813
Dec 10 20:02:27 homestead mysqld[1611]: 2016-12-10 20:02:27 140574075632384 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 10 20:02:27 homestead kernel: [  102.937893] audit: type=1400 audit(1481400147.726:18): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=2030 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=113 ouid=0
Dec 10 20:02:27 homestead kernel: [  102.938561] audit: type=1400 audit(1481400147.726:19): apparmor="DENIED" operation="sendmsg" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/mysqld" name="run/systemd/notify" pid=1611 comm="mysqld" requested_mask="w" denied_mask="w" fsuid=113 ouid=0
Dec 10 20:02:27 homestead systemd[1]: Failed to start MariaDB database server.
Dec 10 20:02:27 homestead systemd[1]: mariadb.service: Unit entered failed state.
Dec 10 20:02:27 homestead systemd[1]: mariadb.service: Failed with result 'timeout'.
Dec 10 20:02:27 homestead systemd[1]: Reached target Multi-User System.
Dec 10 20:02:27 homestead systemd[1]: Starting Notify bootloader that boot was successful...
Dec 10 20:02:27 homestead systemd[1]: Reached target Graphical Interface.
Dec 10 20:02:27 homestead systemd[1]: Starting Update UTMP about System Runlevel Changes...
Dec 10 20:02:27 homestead systemd[1]: Started Update UTMP about System Runlevel Changes.
Dec 10 20:02:27 homestead snap[2063]: Ignoring 'booted' on classic
Dec 10 20:02:27 homestead systemd[1]: Started Notify bootloader that boot was successful.
Dec 10 20:02:27 homestead systemd[1]: Startup finished in 5.989s (kernel) + 1min 36.860s (userspace) = 1min 42.850s.

第一行写着mariadb.service,在我被踢出MySQL的那一刻被记录下来。但我不知道为什么

看起来日志暗示 MySQL / MariaDB 在启动该框后仍在尝试启动 - 尽管此时我已经能够毫无问题地连接到它们。然后发生了一些神秘的超时,整个事情都关闭了。

谁能帮我解释一下……?谢谢!

【问题讨论】:

    标签: mysql ubuntu mariadb homestead


    【解决方案1】:

    终于弄明白了 - AppArmor 似乎是造成问题的原因。

    following the steps outlined here 解决了这个问题,MySQL 不再意外关闭。

    【讨论】:

    • 在我的情况下将 mysqld 移动到“complain”组是不够的(在 Ubuntu 16.04 上运行的 MariaDB 10.1.21)。我必须完全禁用 mysqld 的 apparmor(请参阅我在 stackoverflow.com/a/42271848/2332365 的回答)
    猜你喜欢
    • 2014-05-16
    • 1970-01-01
    • 2013-06-26
    • 1970-01-01
    • 1970-01-01
    • 2011-11-24
    • 1970-01-01
    • 2017-10-16
    • 1970-01-01
    相关资源
    最近更新 更多