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 ...
随机推荐
- Spring Boot学习笔记----POI(Excel导入导出)
业务:动态生成模板导出Excel,用户修改完再导入Excel. Spring boot + bootstrap + poi 1.添加Dependence <dependency> < ...
- 数据结构~trie树(字典树)
1.概述 Trie树,又称字典树,单词查找树或者前缀树,是一种用于快速检索的多叉树结构,如英文字母的字典树是一个26叉树,数字的字典树是一个10叉树. 我理解字典树是看了这位大佬博客.还不了解字典树的 ...
- 基于spec互评Alpha版本
作业要求[https://edu.cnblogs.com/campus/nenu/2018fall/homework/2323] 队名:二次元梦之队 组长:刘莹莹 组员:周昊 潘世维 王玉潘 赵美增 ...
- <Spark><Programming><RDDs>
Introduction to Core Spark Concepts driver program: 在集群上启动一系列的并行操作 包含应用的main函数,定义集群上的分布式数据集,操作数据集 通过 ...
- 初识Linux------文件管理
初识Linux------文件管理 说明 由于本章的命令比较多,先对命令有一个整体的说明 命令的一般格式:命令名[选项][参数1][参数2]…… 命令名由小写的英文字母构成,往往是表示相应功能的英文单 ...
- ios轮播图片用法
// // ZQRViewController.m // 04-图片轮播器 // // Created by apple on 17-08-24. // Copyright (c) 2017年 zzq ...
- 如何HACK无线家用警报器?
30年前,报警器都是硬连线的,具有分立元件,并由钥匙开关操作.20年前,他们已经演变为使用微控制器,LCD和键盘,但仍然是硬连线.10年前,无线报警器开始变得普及,并增加了许多之前没有的功能. 而如今 ...
- day 03 变量与基本数据类型
变量的命名规范 一:变量命名的大前提,应该能够反映出变量值所记录内容 1:变量名只能由数字,字母,下划线组成 2:变量名不能以数字开头 3:变量名不能使用系统的关键字,不然可能会报错 二:变量名的命名 ...
- HSTS 与 307 状态码
最近线上产品突然在 Chrome 浏览器上出现 307 状态码,并跳转到 https 版.由于 https 尚未部署完毕,导致了相当严重的后果. 但是 307 代码是什么含义呢?页面又为何会出现 30 ...
- Go parameter passing
package main import ( "fmt" ) func main() { fmt.Println("Hello, playground") var ...