VPS侦探论坛

 找回密码
 注册
查看: 3878|回复: 8

数据库经常挂掉

[复制链接]
发表于 2017-6-11 20:59:24 | 显示全部楼层 |阅读模式

军哥,lnmp 1.3,最近数据库经常挂掉,数据库错误日志内容如下:
170611 18:06:52 mysqld_safe Number of processes running now: 0
170611 18:06:52 mysqld_safe mysqld restarted
2017-06-11 18:06:53 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.29-log) starting as process 32286 ...
2017-06-11 18:06:53 32286 [Note] Plugin 'FEDERATED' is disabled.
2017-06-11 18:06:53 32286 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-06-11 18:06:53 32286 [Note] InnoDB: The InnoDB memory heap is disabled
2017-06-11 18:06:53 32286 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-06-11 18:06:53 32286 [Note] InnoDB: Memory barrier is not used
2017-06-11 18:06:53 32286 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-06-11 18:06:53 32286 [Note] InnoDB: Using CPU crc32 instructions
2017-06-11 18:06:53 32286 [Note] InnoDB: Initializing buffer pool, size = 256.0M
InnoDB: mmap(274726912 bytes) failed; errno 12
2017-06-11 18:06:53 32286 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-06-11 18:06:53 32286 [ERROR] Plugin 'InnoDB' init function returned error.
2017-06-11 18:06:53 32286 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-06-11 18:06:53 32286 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-06-11 18:06:53 32286 [ERROR] Aborting

2017-06-11 18:06:53 32286 [Note] Binlog end
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'partition'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'ARCHIVE'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_METRICS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_CMP'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'INNODB_TRX'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'BLACKHOLE'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'CSV'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'MyISAM'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'MRG_MYISAM'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'MEMORY'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'sha256_password'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'mysql_old_password'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'mysql_native_password'
2017-06-11 18:06:53 32286 [Note] Shutting down plugin 'binlog'
2017-06-11 18:06:53 32286 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

170611 18:06:53 mysqld_safe mysqld from pid file /usr/local/mysql/var/iZbp1h44q15c9j13hfqfdeZ.pid ended



是不是不支持innodb的问题?

谢谢。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-6-12 09:31:23 | 显示全部楼层


按提示是无法分配内存,也就是内存不够用了
可以先调整/etc/my.conf 中 innodb_buffer_pool_size 调小些看看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-6-12 09:44:47 | 显示全部楼层

好的,之前是256,现在调整到128了;

继续观察中,感谢军哥/
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-6-14 19:41:41 | 显示全部楼层



军哥,你好:

调整到128M之后,坚持了两天,数据库又挂了,一下是这次的数据库日志,还能调整到64M,还是有其它可以继续优化?

又出现了 Unknown/unsupported storage engine: InnoDB ,是不是默认没有开启支持InnoDB的原因?

5305        170614 19:15:29 mysqld_safe Number of processes running now: 0
  5306        170614 19:15:29 mysqld_safe mysqld restarted
  5307        2017-06-14 19:15:30 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.29-log) starting as process 28604 ...
  5308        2017-06-14 19:15:30 28604 [Note] Plugin 'FEDERATED' is disabled.
  5309        2017-06-14 19:15:30 28604 [Note] InnoDB: Using atomics to ref count buffer pool pages
  5310        2017-06-14 19:15:30 28604 [Note] InnoDB: The InnoDB memory heap is disabled
  5311        2017-06-14 19:15:30 28604 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  5312        2017-06-14 19:15:30 28604 [Note] InnoDB: Memory barrier is not used
  5313        2017-06-14 19:15:30 28604 [Note] InnoDB: Compressed tables use zlib 1.2.3
  5314        2017-06-14 19:15:30 28604 [Note] InnoDB: Using CPU crc32 instructions
  5315        2017-06-14 19:15:30 28604 [Note] InnoDB: Initializing buffer pool, size = 128.0M
  5316        InnoDB: mmap(137363456 bytes) failed; errno 12
  5317        2017-06-14 19:15:30 28604 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
  5318        2017-06-14 19:15:30 28604 [ERROR] Plugin 'InnoDB' init function returned error.
  5319        2017-06-14 19:15:30 28604 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  5320        2017-06-14 19:15:30 28604 [ERROR] Unknown/unsupported storage engine: InnoDB
  5321        2017-06-14 19:15:30 28604 [ERROR] Aborting
  5322       
  5323        2017-06-14 19:15:30 28604 [Note] Binlog end
  5324        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'partition'
  5325        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
  5326        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'ARCHIVE'
  5327        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
  5328        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
  5329        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
  5330        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
  5331        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
  5332        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
  5333        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
  5334        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
  5335        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
  5336        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
  5337        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
  5338        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
  5339        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
  5340        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_FT_DELETED'
  5341        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
  5342        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_METRICS'
  5343        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
  5344        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
  5345        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
  5346        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
  5347        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
  5348        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
  5349        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_CMPMEM'
  5350        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_CMP_RESET'
  5351        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_CMP'
  5352        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
  5353        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_LOCKS'
  5354        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'INNODB_TRX'
  5355        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'BLACKHOLE'
  5356        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'CSV'
  5357        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'MyISAM'
  5358        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'MRG_MYISAM'
  5359        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'MEMORY'
  5360        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'sha256_password'
  5361        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'mysql_old_password'
  5362        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'mysql_native_password'
  5363        2017-06-14 19:15:30 28604 [Note] Shutting down plugin 'binlog'
  5364        2017-06-14 19:15:30 28604 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
  5365       
  5366        170614 19:15:30 mysqld_safe mysqld from pid file /usr/local/mysql/varxxxxx.pid ended

谢谢军哥~
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-6-15 09:33:58 | 显示全部楼层

回复 4# 的帖子


没开启innodb就不是这个提示了
就是内存不够用了,没内存可供分配使用了
你看一下你内存占用情况

你机器什么配置?

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

 楼主| 发表于 2017-6-15 09:41:27 | 显示全部楼层

1核2G内存;

centos 7
发表于 2017-6-15 14:06:33 | 显示全部楼层

回复 6# 的帖子


没内存占用情况没法说
调整 innodb_buffer_pool_size 不行就只能升级配置了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2017-6-15 14:45:14 | 显示全部楼层

现在是128M了,还有必要调整到64M吗?
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2017-6-16 09:20:32 | 显示全部楼层

回复 8# 的帖子


没法升级就只能再往小里调,但是如果使用的innodb引擎的话可能会影响mysql性能

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

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

本版积分规则

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

GMT+8, 2024-11-17 20:28 , Processed in 0.029053 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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