記一次mariadb數(shù)據(jù)庫無法連接
自從自己維護blog以后,基本一個月內(nèi),都會出現(xiàn)1,2次這種錯誤,以前解決的辦法很簡單,就是把虛擬機重啟一下就可以。經(jīng)常是網(wǎng)友在微信,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
其實我也能猜到,肯定是數(shù)據(jù)庫的內(nèi)存使用有啥問題。
有錯誤,其實就是利用google,基本就有答案
http://www.webtrafficexchange.com/solved-mysql-crash-fatal-error-cannot-allocate-memory-buffer-pool
我使用的青云的虛擬機,swap分區(qū),就是1G,所以應該也不需要創(chuàng)建。
編輯 /etc/my.cnf,
[mysqld] innodb_buffer_pool_size=64M
重啟mysql
systemctl restart mariadb
查看swap內(nèi)存使用
# 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
密切關注一下后續(xù)的效果如何。
相關文章
關于mongoose連接mongodb重復訪問報錯的解決辦法
這篇文章主要介紹了關于mongoose連接mongodb重復訪問報錯的解決辦法的相關資料,需要的朋友可以參考下2016-01-01
centos中找回MariaDB數(shù)據(jù)庫root用戶權限的方法
這篇文章主要介紹了centos中找回MariaDB數(shù)據(jù)庫root用戶權限的方法,本文寫的很意思,相信大家會眼前一亮,需要的朋友可以參考下2014-07-07
MongoDB啟動報錯 28663 Cannot start server
今天學習mongoDB的時候,啟動總是失敗,搜了好久找到這個文檔解決了問題,是引擎的問題,需要的朋友可以參考下2020-02-02
在Ubuntu系統(tǒng)中安裝MariaDB數(shù)據(jù)庫的教程
這篇文章主要介紹了在Ubuntu系統(tǒng)中安裝MariaDB數(shù)據(jù)庫的教程,同時也適用于其他Debian系的Linux系統(tǒng),需要的朋友可以參考下2015-06-06

