天天看点

"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 
           

继续阅读