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 ...
随机推荐
- linux:centOs7换源阿里云
备份: mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 下载: wget -O /etc/y ...
- 【转】Mac OS X Terminal 101:终端使用初级教程
最近学习苹果认证的<Mac OS X Support Essentials>教程,看到 Command Line 一节有很多实用的知识,下面选取一部分翻译 + 笔记,整理成此文. 你可以整 ...
- vue-router-9-HTML5 History 模式
vue-router 默认 hash 模式,页面不会重新加载 用路由的 history 模式,利用 history.pushState API 来完成 URL 跳转而无须重新加载页面. const r ...
- Android开发 ---基本UI组件3:单选按钮、多选按钮、下拉列表、提交按钮、重置按钮、取消按钮
Android开发 ---基本UI组件2 1.activity_main.xml 描述: 定义一个用户注册按钮 <?xml version="1.0" encoding=&q ...
- tomcat的安装及配置
1.首先进tomcat官网下载zip压缩文件:http://tomcat.apache.org/download-90.cgi 2.解压缩到指定文件压(后面配置环境变量会用到) 3.配置环境变量 4. ...
- asp.net mvc 实现简单的实时消息推送
因为项目需要,需要在网页上实现消息的推送.在百度上搜索了一下,发现实现网页上的消息推送,可以使用asp.net 中的SignalR类库,当然也可以使用H5的WebSocket Ajax的轮回.当然此 ...
- oracle sequence
代码块 方法一: (1)删除序列; (2)重新创建: 这个方法比较简单粗暴. drop sequence sequence_name; create sequence sequence_name mi ...
- 【python】pandas display选项
import pandas as pd 1.pd.set_option('expand_frame_repr', False) True就是可以换行显示.设置成False的时候不允许换行 2.pd.s ...
- prinft he sprintf
四.printf函数 printf函数返回一个格式化后的字符串. 语法:printf(format,arg1,arg2,arg++) 参数 format 是转换的格式,以百分比符号 (“%”) 开始到 ...
- mysql三范式
第一范式:有主键,具有原子性,字段不可分割. 第二范式:完全依赖,没有部分依赖. 第三范式:没有传递依赖. 总结:数据库设计尽量遵循三范式,但是还是根据实际情况进行取舍,有时候会拿冗余还速度,最总用的 ...