当前位置: 首页> 娱乐> 明星 > Mariadb/MySQL挂了且重启失败

Mariadb/MySQL挂了且重启失败

时间:2025/7/15 2:15:40来源:https://blog.csdn.net/kezhen/article/details/139749720 浏览次数:0次

今天发现线上服务挂了,排查发现是MySQL服务停了且重启失败,排查日志:

1)vim /var/log/mariadb/mariadb.log发现出现了Out of memory

240617 17:02:17 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
240617 17:07:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
240617 17:07:06 [Note] /usr/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 20263 ...
240617 17:07:06 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
240617 17:07:06 InnoDB: The InnoDB memory heap is disabled
240617 17:07:06 InnoDB: Mutexes and rw_locks use GCC atomic builtins
240617 17:07:06 InnoDB: Compressed tables use zlib 1.2.7
240617 17:07:06 InnoDB: Using Linux native AIO
240617 17:07:06 InnoDB: Initializing buffer pool, size = 256.0M
InnoDB: mmap(275513344 bytes) failed; errno 12
240617 17:07:06 InnoDB: Completed initialization of buffer pool
240617 17:07:06 InnoDB: Fatal error: cannot allocate memory for the buffer pool
240617 17:07:06 [ERROR] Plugin 'InnoDB' init function returned error.
240617 17:07:06 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
240617 17:07:07 [Note] Plugin 'FEEDBACK' is disabled.
240617 17:07:07 [ERROR] Unknown/unsupported storage engine: InnoDB
240617 17:07:07 [ERROR] Aborting 

2)查看系统内存占用,free -mh 发现系统内存已占满;

3)使用top分析,未看到内存占用高的进程,使用"ps aux --sort=-%mem | head -n 11"查看,发现有进程占用大量内存;

4)kill掉所有高占用内存(kill -9  $(ps -aux |grep 进程名 |awk '{print $2}')),重启MySQL成功。

关键字:Mariadb/MySQL挂了且重启失败

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: