เช้าวันนี้ MariaDB หยุดทำงาน (อีกแล้ว....)
ก่อนอื่นให้ปิดเว็บก่อน เพื่อไม่ให้มี request เข้ามาค้างในระบบ
sudo service nginx stop
แล้วตรวจสอบ error
sudo journalctl -f -u mariadb.service --since=today
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/mariadb.service.d
└─mariadb_custom.conf, migrated-from-my.cnf-settings.conf
Active: activating (auto-restart) (Result: resources) since Tue 2026-07-07 06:55:31 +07;>
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Tasks: 40 (limit: 251281)
Memory: 20.3G (peak: 25.9G swap: 781.1M swap peak: 797.6M)
CPU: 1d 15h 15min 2.877s
sudo dmesg -T | grep -i -E 'oom|kill|mariadb'
ไม่พบอะไร
จาก error message ดูเหมือน
Looking at your status output, your server is using massive amounts of memory (20.3G currently active, 25.9G peak). This almost always means MariaDB is crashing due to the Linux Out-Of-Memory (OOM) killer.
กิน memory มากเกินจนค้าง zombi เลยสั่ง kill (17732) ซะ
sudo service mariadb stop ps aux | grep mariadb sudo kill -9 xxxxx
Reset mariadb error ก่อน แล้วค่อยสั่ง start ใหม่
sudo systemctl reset-failed mariadb.service sudo systemctl daemon-reload sudo systemctl start mariadb.service sudo systemctl status mariadb.service
หลังจากนั้นก็ตรวจสอบและซ่อมแซมตารางที่พัง
sudo mariadb-check --all-databases --auto-repair
อย่าลืมเปิด nginx กลับมาด้วย
sudo service nginx start
จบ
ปล. กรณีนี้ การซ่อมแซมอัตโนมัติไม่สำเร็จ ต้องเข้าไปซ่อมเองที่ phpmyadmin
Relate topics
- ddosify : Load Test - ไม่ผ่าน
- macOS 12 Monterey: Web Server Setup/Apache/MariaDB/PHP Multiple Versions
- Ubuntu Server Installation
- อีกที : macOS 11.0 Big Sur Apache/MiriaDB/PHP Setup
- Ubuntu Web Server Setup
- Apache Config on Ubuntu Server :: Manual add new site
- Check and Repair Hardisk
- Install AFP Share Server Protocal on Linux
- วิธีการติดตั้ง Let’s Encrypt automated free SSL certificate
- Linux Server Tools
- Make Macbook Pro to be Web Server
- พบบั๊ก GHOST ใน glibc ความร้ายแรงระดับสูง กระทบลินุกซ์รุ่นเก่าจำนวนมาก
- Server Setup : การกำหนดสิทธิ์ Root ให้กับ user บน Ubuntu 14.04
- Setup FTP Server under Ubuntu/Debian
- ย้ายบ้านให้ MySql
- Debian : ปิดการตรวจสอบฮาร์ดดิสอัตโนมัติขณะเปิดเครื่อง
- Dabian bandwidth monitoring
- อีกครั้ง - Make Ubuntu 16.04 to be a web server (LAMP)
- Directadmin เข้า port 2222 ไม่ได้
- How to update Directadmin by SSH