自从自己维护blog以后,基本一个月内,都会出现1,2次这种错误,以前解决的办法很简单,就是把虚拟机重启一下就可以。经常是网友在微信,qq,微博提醒我blog挂掉。
刚好国庆期间碰上,就顺便提高一下自己的运维能力,看看具体的原因。
tail /var/log/mariadb/mariadb.log
看到大概的错误
161004 11:21:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
161004 11:21:05 [ERROR] Plugin 'InnoDB' init function returned error.
161004 11:21:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
161004 11:21:15 [Note] Plugin 'FEEDBACK' is disabled.
161004 11:21:16 [ERROR] Unknown/unsupported storage engine: InnoDB
161004 11:21:16 [ERROR] Aborting
其实我也能猜到,肯定是数据库的内存使用有啥问题。
有错误,其实就是利用google,基本就有答案
http://www.webtrafficexchange.com/solved-mysql-crash-fatal-error-cannot-allocate-memory-buffer-pool
我使用的青云的虚拟机,swap分区,就是1G,所以应该也不需要创建。
编辑 /etc/my.cnf,
[mysqld] innodb_buffer_pool_size=64M
重启mysql
systemctl restart mariadb
查看swap内存使用
# free -m total used free shared buff/cache available Mem: 993 431 386 6 175 424 Swap: 1023 0 1023
查看一下启动日志
[root@chenshake mariadb]# tail /var/log/mariadb/mariadb.log
161004 20:42:46 InnoDB: Initializing buffer pool, size = 64.0M
161004 20:42:46 InnoDB: Completed initialization of buffer pool
161004 20:42:46 InnoDB: highest supported file format is Barracuda.
161004 20:42:46 InnoDB: Waiting for the background threads to start
密切关注一下后续的效果如何。
更新日志
- 瑞鸣音乐《中国音乐地图之听见河南豫剧经典唱段》2020[WAV分轨]
- 【伊比萨沙发】VA-2024-IbizaSpring2024(LoungeCocktailsfromtheHeart)[FLAC]
- 群星《世界顶级汽车音响试音王》4K金碟16CD[WAV+CUE]
- 群星-音效环绕天碟《极致环绕人声天碟天品》7CD[WAV]
- 泰拉克SACD古典试音碟7SACD-ISO
- 群星《红歌宝典》20CD[WAV/分轨]
- 《101系列:好歌101首 细听年代精选》[WAV+CUE][3.6GB]
- 《101系列 6CD 国语经典101首歌曲 张学友 王菲代表作》[APE+CUE][2.8GB]
- 《101系列:国语经典101 VOL2 6CD 精选最经典101首》[WAV+CUE][2.3GB]
- 群星《十年网络红歌》15CD[WAV分轨]
- 宝丽金-环球10周年至50周年经典金曲15CD[低速原抓WAV+CUE]
- FIM唱片《十大男伶》[低速原抓WAV+CUE]
- 《101系列:情歌101 6CD》[WAV+CUE][3.1GB]
- 庄心妍《降调版合集》[320K/MP3][52.96MB]
- 庄心妍《降调版合集》[FLAC/分轨][118.78MB]