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 ...
随机推荐
- 每天CSS学习之caption-side
caption-side是CSS2的属性,其作用是规定标题的位置在表格的上面还是下面. 1.top:默认值,将表格标题定位在表格之上.如下例子: caption{ caption-side:top; ...
- tomcat原理详解
tomcat的启动是通过Bootstrap类的main方法(tomcat6开始也可以直接通过Catlina的main启动) Bootstrap的启动 Bootstrap的main方法先new了一个自己 ...
- HashMap中hashCode()和equals()重要性
Java中HashMap根据hashCode()和equals()方法来获取键值对的索引,同时也通过这两个方法由key值获取value值.如果没有这两个方法,那么当有两个相同的 hash值时,可能会被 ...
- 一步一步开始FPGA逻辑设计 - 高速接口之PCIe(转)
reference: https://blog.csdn.net/jackxu8/article/details/53288385 这篇文章主要针对Xilinx家V6和K7两个系列的PFGA,在Lin ...
- Oracle 12c中新建pdb用户登录问题分析
Oracle 12c新建用户登录问题分析1 用sys用户新建用户,提示公用用户名或角色名无效.原因:Oracle 12c中,在容器中建用户(或者应该称为使用者),须在用户名前加c##.默认登录连接的就 ...
- php usort
<?phpfunction re($a,$b){ return ($a>$b)?1:-1; }$x=array(1,3,2,5,9);usort($x, 're');print_r($x) ...
- python 异常处理函数--raise
Python 异常处理--raise函数用法 在Python中,要想引发异常,最简单的形式就是输入关键字raise,后跟要引发的异常的名称.异常名称标识出具体的类: Python异常处理是那些类的对象 ...
- git使用简明教程
1.自己在gitlab.XXX.com创建一个项目 点击右上角的"+"符号,创建新项目. 项目名:xxxtest 2.在master分支提交一个文件Readme.txt 文件内容: ...
- 1--Testng功能简介
https://www.yiibai.com/testng/parameterized-test.html
- ES6 Module的语法
下面比较一下默认输出和正常输出. // 第一组 export default function crc32() { // 输出 // ... } import crc32 from 'crc32'; ...