centos Cannot allocate memory for the buffer pool
mysql 无法启动 ,查看日志:
--01T15::.401599Z [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
--01T15::.403209Z [Note] /usr/sbin/mysqld (mysqld 5.7.) starting as process ...
--01T15::.406004Z [Note] InnoDB: PUNCH HOLE support available
--01T15::.406028Z [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
--01T15::.406032Z [Note] InnoDB: Uses event mutexes
--01T15::.406035Z [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
--01T15::.406038Z [Note] InnoDB: Compressed tables use zlib 1.2.
--01T15::.406041Z [Note] InnoDB: Using Linux native AIO
--01T15::.406290Z [Note] InnoDB: Number of pools:
--01T15::.406379Z [Note] InnoDB: Using CPU crc32 instructions
--01T15::.407775Z [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = , chunk size = 128M
--01T15::.407813Z [ERROR] InnoDB: mmap( bytes) failed; errno
--01T15::.407819Z [ERROR] InnoDB: Cannot allocate memory for the buffer pool
--01T15::.407824Z [ERROR] InnoDB: Plugin initialization aborted with error Generic error
--01T15::.407829Z [ERROR] Plugin 'InnoDB' init function returned error.
--01T15::.407832Z [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
--01T15::.407834Z [ERROR] Failed to initialize plugins.
--01T15::.407836Z [ERROR] Aborting --01T15::.407852Z [Note] Binlog end
--01T15::.407890Z [Note] Shutting down plugin 'CSV'
--01T15::.408059Z [Note] /usr/sbin/mysqld: Shutdown complete
定位到最后几行,果然有一个FATAL ERROR:Cannot allocate memory for the buffer pool,看来应该是mariadb没有配置好,php程序访问量稍微大一些,分配给mariadb的内存就满了,然后就锁死了,mysql –u root –p竟然也打不开,看来确实是mariadb daemon挂掉了…
Innodb 存储引擎的缓存机制和 MyISAM 的最大区别就在于 Innodb 不仅仅缓存索引,同时还会缓存实际的数据。所以,完全相同的数据库,使用 Innodb 存储引擎可以使用更多的内存来缓存数据库相关的信息,当然前提是要有足够的物理内存。innodb_buffer_pool_size 参数用来设置 Innodb 最主要的 Buffer(Innodb_Buffer_Pool)的大小,也 就是缓存用户表及索引数据的最主要缓存空间,对 Innodb 整体性能影响也最大。这个参数设置成内存的50%-80%,当然具体要结合实际情况而定,考虑别的存储引擎占用的内存,考虑服务器是不是还提供其他服务等等…看来,我的机器之所以宕掉的原因是,系统默认的内存:
default innodb_buffer_pool_size
innodb_buffer_pool_size=50M
再次启动
sudo systemctl start mysqld
恢复正常
关闭suse:
查看SELinux状态:
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
2、getenforce ##也可以用这个命令检查
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
参考:https://blog.feehi.com/linux/132.html
mysql安装:
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-centos-7
centos Cannot allocate memory for the buffer pool的更多相关文章
- MySql启动,提示:Plugin 'FEDERATED' is disabled....Cannot allocate memory for the buffer pool
2016-05-27 09:25:01 31332 [Note] Plugin 'FEDERATED' is disabled. 2016-05-27 09:25:01 31332 [Note] In ...
- [ERROR] InnoDB: Cannot allocate memory for the buffer pool
:: mysqld_safe Starting mysqld daemon with databases from /data/mysqldb -- :: [Note] /usr/local/mysq ...
- mysql报错mmap(137428992 bytes) failed; errno 12,Cannot allocate memory for the buffer pool
mysql以`systemctl start mysqld.service`的方式启动一段时间后发现突然无法启动,尝试重新启动也不能解决问题,排查问题时,先后通过`systemctl status m ...
- mysql启动报错cannot allocate memory for the buffer pool处理
今天启动mysql服务器时失败了.去/var/log/mysql/查看error.log,报错信息如下: 160123 22:29:26 InnoDB: Initializing buffer poo ...
- Fatal error: cannot allocate memory for the buffer pool
mysql有时候会被系统kill掉,原因是内存不够了,一般都是Ubuntu出现的,因为Ubuntu吃内存,你们又给的不多.. 咋解决呢? 重启服务器是可以的,起码暂时可以了, 可以考虑加内存,或者增加 ...
- Cannot allocate memory for the buffer pool
优化了一通,启动不了 直接上日志 innodb_buffer_pool_size”.”key_buffer_size” 的大小设置,适当的调大内存分配,减小,然后保存配置文件,重新尝试启mysql 成 ...
- MySQL:cannot allocate the memory for the buffer pool
InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins Inno ...
- [转]MySQL innodb buffer pool
最近在对公司的 MySQL 服务器做性能优化, 一直对 innodb 的内存使用方式不是很清楚, 乘这机会做点总结. 在配置 MySQL 的时候, 一般都会需要设置 innodb_buffer_poo ...
- InnoDB Status Output – Buffer Pool and Spin Rounds
InnoDB has a good source of information about its status which can be requested every time you need ...
随机推荐
- 将一个xml文件解析到一个list中
public List<News> getListFromXml(InputStream in) { XmlPullParser parser = Xml.newPullParser(); ...
- flask项目结构(三)使用蓝图
简介: Flask中的蓝图旨在针对这些情况: 把一个应用分解成一系列的蓝图.对于大型的应用是理想化的:一个项目能实例化一个应用, 初始化一些扩展,以及注册一系列的蓝图. 以一个 URL 前缀和/或子域 ...
- [Leetcode 104]求二叉树的深度Depth of BinaryTree
[题目] Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the ...
- 2.16 C++类与new和delete操作符
参考: http://www.weixueyuan.net/view/6347.html 总结: 当我们需要为类对象动态分配存储空间时,我们应该使用C++语言提供的new与new[]操作符,而不要使用 ...
- SQL--数据表--基本操作
表操作 表与字段是密不可分的. 新增数据表 Create table [if not exists] 表名(字段名字 数据类型,字段名字 数据类型 --最后一行不需要逗号) [表选项] ; if no ...
- input获取焦点无效
js控制input获得焦点: $("input").focus(); 无效,写在延时函数中问题解决: setTimeout(function(){ $("input&qu ...
- MySql:触发器
触发器 一.触发器的定义: 触发器是个特殊的存储过程,不同的是,执行存储过程要使用CALL语句来调用,而触发器的执行不需要使用CALL语句来调用,也不需要手工启动,只要当一个预定的事件发生时,就会被M ...
- css 1) calc() 函数的使用. 2)box-sizing:border-box
calc() 是一个css 函数, 可以实现.计算 ---------------------------- 1. 每个div宽度是25%; 总共4个div. 同时 前三个div 有 border-r ...
- SQL server的高可用
SQL server 2012实现数据库中的表同步到局域网中的另外一个服务器上的数据库的方法: 1.发布.订阅功能 2.AlwayOn功能(最稳定.最优的方案) 3.修改程序,写两份数据,或者用触发器 ...
- Spring Boot 揭秘与实战(二) 数据缓存篇 - EhCache
文章目录 1. EhCache 集成 2. 源代码 本文,讲解 Spring Boot 如何集成 EhCache,实现缓存. 在阅读「Spring Boot 揭秘与实战(二) 数据缓存篇 - 快速入门 ...