2016-12-10 18 views
2

我已經通過VirtualBox和Vagrant在macOS Sierra上安裝了Homestead。一切正常,除了一些神祕的原因MySQL在盒子已經超過1分42秒後關閉了自己...正好1分42秒後MySQL/MariaDB關閉

我能夠在第一分鐘42秒內沒有問題地使用MySQL,但然後服務突然關閉並拒絕進一步的連接。

tail/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仍然試圖啓動盒子後,即使我已經能夠連接到他們沒有問題。然後,一些神祕超時被擊中,整個事情關閉。

任何人都可以幫我解釋這個......嗎?謝謝!

回答

2

終於明白了--AppArmor似乎是造成這個問題的原因。

通過following the steps outlined here,我能夠解決這個問題,MySQL不再關閉意外。

+0

將mysqld移到「抱怨」組是不夠的(在Ubuntu 16.04上運行MariaDB 10.1.21)。我必須完全禁用mysqld的apparmor(請參閱http://stackoverflow.com/a/42271848/2332365上的答案) – Vincent