VPS侦探论坛

 找回密码
 注册
查看: 3321|回复: 4

mysql频繁自动结束或僵死,自动重启都无用

[复制链接]
发表于 2017-6-22 12:51:50 | 显示全部楼层 |阅读模式

错误代码:
  1. 170622 12:30:03 [Note] Plugin 'FEDERATED' is disabled.
  2. 170622 12:30:03 InnoDB: The InnoDB memory heap is disabled
  3. 170622 12:30:03 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  4. 170622 12:30:03 InnoDB: Compressed tables use zlib 1.2.7
  5. 170622 12:30:03 InnoDB: Initializing buffer pool, size = 32.0M
  6. InnoDB: mmap(34340864 bytes) failed; errno 12
  7. 170622 12:30:03 InnoDB: Completed initialization of buffer pool
  8. 170622 12:30:03 InnoDB: Fatal error: cannot allocate memory for the buffer pool
  9. 170622 12:30:03 [ERROR] Plugin 'InnoDB' init function returned error.
  10. 170622 12:30:03 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  11. 170622 12:30:03 [ERROR] Unknown/unsupported storage engine: InnoDB
  12. 170622 12:30:03 [ERROR] Aborting

  13. 170622 12:30:03 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

  14. 170622 12:30:03 mysqld_safe mysqld from pid file /data/var/ebs-47166.pid ended
  15. 170622 12:31:02 mysqld_safe Starting mysqld daemon with databases from /data/var
  16. 170622 12:31:02 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.48) starting as process 29689 ...
  17. 170622 12:31:02 [Note] Plugin 'FEDERATED' is disabled.
  18. 170622 12:31:02 InnoDB: The InnoDB memory heap is disabled
  19. 170622 12:31:02 InnoDB: Mutexes and rw_locks use GCC atomic builtins
  20. 170622 12:31:02 InnoDB: Compressed tables use zlib 1.2.7
  21. 170622 12:31:02 InnoDB: Initializing buffer pool, size = 32.0M
  22. InnoDB: mmap(34340864 bytes) failed; errno 12
  23. 170622 12:31:02 InnoDB: Completed initialization of buffer pool
  24. 170622 12:31:02 InnoDB: Fatal error: cannot allocate memory for the buffer pool
  25. 170622 12:31:02 [ERROR] Plugin 'InnoDB' init function returned error.
  26. 170622 12:31:02 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  27. 170622 12:31:02 [ERROR] Unknown/unsupported storage engine: InnoDB
  28. 170622 12:31:02 [ERROR] Aborting

  29. 170622 12:31:02 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

  30. 170622 12:31:02 mysqld_safe mysqld from pid file /data/var/ebs-47166.pid ended
复制代码
自动重启代码:
  1. #!/bin/bash
  2. pgrep -x mysqld &> /dev/null
  3. if [ $? -ne 0 ]
  4. then
  5. echo "At time: `date` :MySQL error stop ." >> /home/wwwlogs/mysql_error_stop.log
  6. /etc/init.d/mysql start
  7. #echo "At time: `date` :MySQL server is stop."
  8. else
  9. echo "MySQL server is running ."
  10. fi
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-6-22 12:54:56 | 显示全部楼层


mysql路径从/usr/local/mysql变更为/data/了,但是innode没有变更路径,仍然是/usr/local/mysql
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-6-22 18:28:23 | 显示全部楼层

机器什么配置?
innodb_buffer_pool_size 调小些
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-6-23 22:54:05 | 显示全部楼层

回复 3# 的帖子




只有16M了,机器内存总共2G
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-6-24 09:07:16 | 显示全部楼层

回复 4# 的帖子


估计有其他很占内存的程序,mysql都无法进行分配内存,如果不需要innodb可以关闭,就不受这个影响了

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 21:31 , Processed in 0.027017 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表