Hướng dẫn mysqld service holdoff time over, scheduling restart - hết thời gian tạm dừng dịch vụ mysqld, lên lịch khởi động lại

Máy chủ: Linode chuyên dụng 4G Ubuntu 18.04, webmin + VirtualMin

Thỉnh thoảng, máy chủ MySQL dừng lại và thất bại khi khởi động lại. Đây là nhật ký tôi có thể tìm thấy:

Apr 11 20:54:57 bamboo kernel: [ 2082.915857] [ 7664]   112  7664   406072    46295   745472        3             0 mysqld
Apr 11 20:54:57 bamboo kernel: [ 2082.915859] [ 7701]     0  7701   129687      307   679936     1435             0 apache2
Apr 11 20:54:57 bamboo kernel: [ 2082.915860] [ 7702]     0  7702   129683      253   667648     1487             0 apache2
Apr 11 20:54:57 bamboo kernel: [ 2082.915861] Out of memory: Kill process 7664 [mysqld] score 40 or sacrifice child
Apr 11 20:54:57 bamboo kernel: [ 2082.919284] Killed process 7664 [mysqld] total-vm:1624288kB, anon-rss:185180kB, file-rss:0kB, shmem-rss:0kB
Apr 11 20:54:57 bamboo kernel: [ 2082.941447] oom_reaper: reaped process 7664 [mysqld], now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Apr 11 20:54:57 bamboo systemd[1]: mysql.service: Main process exited, code=killed, status=9/KILL
Apr 11 20:54:57 bamboo systemd[1]: mysql.service: Failed with result 'signal'.
Apr 11 20:54:57 bamboo systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 11 20:54:57 bamboo systemd[1]: mysql.service: Scheduled restart job, restart counter is at 4.
Apr 11 20:54:57 bamboo systemd[1]: Stopped MySQL Community Server.

..........

Apr 11 14:02:53 bamboo systemd[1]: mysql.service: Scheduled restart job, restart counter is at 4.
Apr 11 14:02:53 bamboo systemd[1]: Stopped MySQL Community Server.
Apr 11 14:02:53 bamboo systemd[1]: Starting MySQL Community Server...
Apr 11 14:02:53 bamboo mysqld[4345]: Initialization of mysqld failed: 0
Apr 11 14:02:53 bamboo systemd[1]: mysql.service: Control process exited, code=exited status=1
Apr 11 14:02:53 bamboo systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 11 14:02:53 bamboo systemd[1]: Failed to start MySQL Community Server.
Apr 11 14:02:53 bamboo systemd[1]: mysql.service: Service hold-off time over, scheduling restart.

Có vẻ như đó là một vấn đề bộ nhớ. Nhưng tôi đang lưu trữ một số trang web WordPress rất nhỏ trên máy chủ này và họ không thể sử dụng hết bộ nhớ.

Đồ thị máy chủ:

Bạn có thể thấy có một sự tăng đột biến sử dụng CPU và đó là khi cơ sở dữ liệu MySQL bị dừng.

Vào thời điểm đó, tôi đã không làm bất cứ điều gì đặc biệt nên tôi rất khó để tái tạo vấn đề và người quan sát nguyên nhân có thể. Tôi đoán để điều tra điều này tôi cần nhìn sâu hơn vào các bản ghi, nhưng điều này hoàn toàn vượt quá kiến ​​thức của tôi.

Ai đó có thể làm sáng tỏ cách tìm kiếm nguyên nhân có thể?

HĐH: Centos 7 Linux 3.10.0-229.EL7.x86_64:Centos 7 Linux 3.10.0-229.el7.x86_64

MySQL: mysql57-community-release-el7-7.noarch.rpm: mysql57-community-release-el7-7.noarch.rpm

Tôi đã cài đặt máy chủ MySQL thông qua yum. Khi tôi chạy systemctl start mysqld, tôi gặp lỗi sau

Công việc cho mysqld.service không thành công. Xem 'Trạng thái SystemCtl mySQLD.Service' và 'Tạp chíCTL -XN' để biết chi tiết.

Trạng thái SystemCtl mysqld.service

MySQL Server Loaded: loaded [/usr/lib/systemd/system/mysqld.service; enabled] 
Active: failed [Result: start-limit] since Sun 2015-12-06 03:14:54 GMT;
4min 7s ago Process: 6992 ExecStart=/usr/sbin/mysqld
--daemonize $MYSQLD_OPTS [code=exited, status=1/FAILURE] Process: 6971 ExecStartPre=/usr/bin/mysqld_pre_systemd [code=exited,
status=0/SUCCESS] 
Dec 06 03:14:54 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exited status=1 
Dec 06 03:14:54 localhost.localdomain systemd[1]: Failed to start MySQL Server. 
Dec 06 03:14:54 localhost.localdomain systemd[1]: Unit  mysqld.service entered failed state. 
Dec 06 03:14:54 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart. 
Dec 06 03:14:54 localhost.localdomain systemd[1]: Stopping MySQL Server... 
Dec 06 03:14:54 localhost.localdomain systemd[1]: Starting MySQL Server...   
Dec 06 03:14:54 localhost.localdomain systemd[1]: mysqld.service start request repeated too quickly, refusing to start. 
Dec 06 03:14:54 localhost.localdomain systemd[1]: Failed to start MySQL Server. 
Dec 06 03:14:54 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state. The journal command reads Failed to start MySQL Server

Bất kỳ ý tưởng gì tôi nên xem xét?

Chào bạn,

Tôi có một vấn đề lớn trên giọt nước của tôi.

Hôm nay, sau khi kéo từ repo git của tôi, tôi cài đặt tiện ích mở rộng PHP [Imagick].

Sau đó, MySQL bắt đầu/dừng lại thường xuyên, và bây giờ tôi không thể khởi động lại nó.

Nếu tôi cố gắng:

sudo service mysql restart

Nó nói tôi

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

Nhật ký của tạp chí -xe nói:

-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: //lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has failed.
-- 
-- The result is failed.
Apr 25 10:41:38 wordpress-512mb-ams3-01 systemd[1]: mysql.service: Unit entered failed state.
Apr 25 10:41:38 wordpress-512mb-ams3-01 systemd[1]: mysql.service: Failed with result 'exit-code'.
Apr 25 10:41:38 wordpress-512mb-ams3-01 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Apr 25 10:41:38 wordpress-512mb-ams3-01 systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: //lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has finished shutting down.
Apr 25 10:41:38 wordpress-512mb-ams3-01 systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: //lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit mysql.service has begun starting up.
Apr 25 10:41:38 wordpress-512mb-ams3-01 audit[3864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/3864/status" pid=3864 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=112
Apr 25 10:41:38 wordpress-512mb-ams3-01 kernel: audit: type=1400 audit[1493116898.796:1567]: apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/3864/status" pid=3864 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=112
Apr 25 10:41:38 wordpress-512mb-ams3-01 audit[3864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=3864 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=0
Apr 25 10:41:38 wordpress-512mb-ams3-01 audit[3864]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/3864/status" pid=3864 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=112
Apr 25 10:41:38 wordpress-512mb-ams3-01 kernel: audit: type=1400 audit[1493116898.812:1568]: apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=3864 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=0
Apr 25 10:41:38 wordpress-512mb-ams3-01 kernel: audit: type=1400 audit[1493116898.812:1569]: apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/3864/status" pid=3864 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=112 ouid=112
Apr 25 10:41:39 wordpress-512mb-ams3-01 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

Và cuối cùng, /var/log/mysql/error.log nói:

2017-04-25T10:45:43.868541Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-04-25T10:45:43.868576Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-04-25T10:45:43.868596Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-04-25T10:45:43.868615Z 0 [ERROR] Failed to initialize plugins.
2017-04-25T10:45:43.868629Z 0 [ERROR] Aborting

2017-04-25T10:45:43.868673Z 0 [Note] Binlog end
2017-04-25T10:45:43.868837Z 0 [Note] Shutting down plugin 'CSV'
2017-04-25T10:45:43.869563Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

Bất kỳ sự giúp đỡ sẽ được đánh giá cao, cảm ơn bạn trước.

Những câu trả lời này được cung cấp bởi cộng đồng của chúng tôi.Nếu bạn thấy chúng hữu ích, hãy thể hiện một số tình yêu bằng cách nhấp vào trái tim.Nếu bạn gặp vấn đề để lại nhận xét, hoặc thêm câu trả lời của riêng bạn để giúp đỡ người khác.

Bài Viết Liên Quan

Chủ Đề