天天看點

"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 
           

繼續閱讀