Mariadb/MySQL挂了且重启失败

今天发现线上服务挂了,排查发现是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成功。

相关推荐

  1. Mariadb/MySQL失败

    2024-06-17 20:14:06       8 阅读
  2. 手误修改spfile导致实例失败

    2024-06-17 20:14:06       10 阅读
  3. K8S容器后一直但不成功原因及解决

    2024-06-17 20:14:06       39 阅读
  4. 手机手app没

    2024-06-17 20:14:06       16 阅读
  5. 华纳云:ubuntu中mysql失败怎么解决

    2024-06-17 20:14:06       36 阅读
  6. Docker服务启动失败请求频繁被拒绝

    2024-06-17 20:14:06       38 阅读
  7. IDEA异常退出后项目启动失败解决

    2024-06-17 20:14:06       33 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-17 20:14:06       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-17 20:14:06       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-17 20:14:06       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-17 20:14:06       20 阅读

热门阅读

  1. 软设之白盒测试

    2024-06-17 20:14:06       6 阅读
  2. 时区设置函数【man 3 tzset】

    2024-06-17 20:14:06       5 阅读
  3. 中国环保网元宇宙:开启绿色数字生活新篇章

    2024-06-17 20:14:06       9 阅读
  4. 哪些不得不记下的汇编指令

    2024-06-17 20:14:06       5 阅读
  5. leetcode153. 寻找旋转排序数组中的最小值

    2024-06-17 20:14:06       8 阅读
  6. MT1434 找数字

    2024-06-17 20:14:06       8 阅读
  7. 2024 6.10~6.16 周报

    2024-06-17 20:14:06       7 阅读
  8. 工作学习记录

    2024-06-17 20:14:06       7 阅读