"systemctl status mariadb.service" and "journalctl -xe" for details

今天php 在做swoole 時啓動一個進程
正運行着哪突然所有接口都沒了反應
進入服務查看發現 nginx mysql 都停止運行了

在啓動mysql 時出現

Job for mariadb.service failed because the control process exited with error code. 
See "systemctl status mariadb.service" and "journalctl -xe" for details.

查找步驟

1.進入 mysql 日誌文件
less /var/log/mariadb/mariadb.log 

找到錯誤日誌
190917 11:39:44 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended
190917 11:40:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
190917 11:40:30 [Note] /usr/libexec/mysqld (mysqld 5.5.60-MariaDB) starting as process 29084 ...
190917 11:40:30 [ERROR] mysqld: Out of memory (Needed 128917504 bytes)
190917 11:40:30 [ERROR] mysqld: Out of memory (Needed 96681984 bytes)
190917 11:40:30 [ERROR] mysqld: Out of memory (Needed 72499200 bytes)
190917 11:40:30 InnoDB: The InnoDB memory heap is disabled
190917 11:40:30 InnoDB: Mutexes and rw_locks use GCC atomic builtins
190917 11:40:30 InnoDB: Compressed tables use zlib 1.2.7
190917 11:40:30 InnoDB: Using Linux native AIO
190917 11:40:30 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137756672 bytes) failed; errno 12
190917 11:40:30 InnoDB: Completed initialization of buffer pool
190917 11:40:30 InnoDB: Fatal error: cannot allocate memory for the buffer pool
190917 11:40:30 [ERROR] Plugin 'InnoDB' init function returned error.
190917 11:40:30 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
190917 11:40:30 [Note] Plugin 'FEEDBACK' is disabled.
190917 11:40:30 [ERROR] Unknown/unsupported storage engine: InnoDB
190917 11:40:30 [ERROR] Aborting
大概意思是:致命錯誤,超出內存,已經分配allocated 262144,嘗試分配19456 字節。

2.經過網上查找最終解決方案
修改php.ini
	max_execution_time = 120 ;每個腳本的最長執行時間(秒)
	max_input_time = 60 ; 每個腳本解析請求數據的最長時間
	memory_limit = 64M ;最大存儲量一個腳本可能消耗
3.重啓php mysql 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章