記一次mariadb數(shù)據(jù)庫無法連接
自從自己維護(hù)blog以后,基本一個月內(nèi),都會出現(xiàn)1,2次這種錯誤,以前解決的辦法很簡單,就是把虛擬機(jī)重啟一下就可以。經(jīng)常是網(wǎng)友在微信,qq,微博提醒我blog掛掉。
剛好國慶期間碰上,就順便提高一下自己的運(yùn)維能力,看看具體的原因。
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í)我也能猜到,肯定是數(shù)據(jù)庫的內(nèi)存使用有啥問題。
有錯誤,其實(shí)就是利用google,基本就有答案
我使用的青云的虛擬機(jī),swap分區(qū),就是1G,所以應(yīng)該也不需要創(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
密切關(guān)注一下后續(xù)的效果如何。
相關(guān)文章:
1. Window7安裝MariaDB數(shù)據(jù)庫及系統(tǒng)初始化操作分析2. Windows10系統(tǒng)下安裝MariaDB 的教程圖解3. MariaDB中的thread pool詳細(xì)介紹和使用方法4. centos 7安裝mysql5.5和安裝 mariadb使用的命令5. MySQL分支選擇參考:Percona還是MariaDB6. 我是如何用2個Unix命令給MariaDB SQL提速的7. 在Ubuntu系統(tǒng)中安裝MariaDB數(shù)據(jù)庫的教程8. CentOS6.7系統(tǒng)中編譯安裝MariaDB數(shù)據(jù)庫9. Mariadb數(shù)據(jù)庫主從復(fù)制同步配置過程實(shí)例10. Linux安裝MariaDB數(shù)據(jù)庫的實(shí)例詳解
