centos Cannot allocate memory for the buffer pool
阿新 • • 發佈:2017-10-02
compress instr suse ocean crc ret imp 參數設置 git
mysql 無法啟動 ,查看日誌:
17-10-01T15:37:27.401599Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2017-10-01T15:37:27.403209Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.19) starting as process 5504 ... 2017-10-01T15:37:27.406004Z 0 [Note] InnoDB: PUNCH HOLE support available 2017-10-01T15:37:27.406028Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2017-10-01T15:37:27.406032Z 0 [Note] InnoDB: Uses event mutexes 2017-10-01T15:37:27.406035Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 2017-10-01T15:37:27.406038Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-10-01T15:37:27.406041Z 0 [Note] InnoDB: Using Linux native AIO 2017-10-01T15:37:27.406290Z 0 [Note] InnoDB: Number of pools: 1 2017-10-01T15:37:27.406379Z 0 [Note] InnoDB: Using CPU crc32 instructions 2017-10-01T15:37:27.407775Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2017-10-01T15:37:27.407813Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12 2017-10-01T15:37:27.407819Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool 2017-10-01T15:37:27.407824Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error 2017-10-01T15:37:27.407829Z 0 [ERROR] Plugin ‘InnoDB‘ init function returned error. 2017-10-01T15:37:27.407832Z 0 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed. 2017-10-01T15:37:27.407834Z 0 [ERROR] Failed to initialize plugins. 2017-10-01T15:37:27.407836Z 0 [ERROR] Aborting 2017-10-01T15:37:27.407852Z 0 [Note] Binlog end 2017-10-01T15:37:27.407890Z 0 [Note] Shutting down plugin ‘CSV‘ 2017-10-01T15:37:27.408059Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
定位到最後幾行,果然有一個FATAL ERROR:Cannot allocate memory for the buffer pool,看來應該是mariadb沒有配置好,php程序訪問量稍微大一些,分配給mariadb的內存就滿了,然後就鎖死了,mysql –u root –p竟然也打不開,看來確實是mariadb daemon掛掉了…
再次啟動
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
重啟機器即可
centos Cannot allocate memory for the buffer pool