MySQL failing to start under Cent OS
阿里云 centos下,mysqld进程进场无缘无故的关闭。
关闭后,无法重启
service mysqld start
MySQL Daemon failed to start.
Starting mysqld: [FAILED]
log信息是这样的:
150306 07:06:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150306 7:06:32 [Note] libgovernor.so not found
150306 7:06:32 [Note] Plugin 'FEDERATED' is disabled.
150306 7:06:32 InnoDB: The InnoDB memory heap is disabled
150306 7:06:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150306 7:06:32 InnoDB: Compressed tables use zlib 1.2.3
150306 7:06:32 InnoDB: Using Linux native AIO
150306 7:06:32 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
150306 7:06:32 InnoDB: Completed initialization of buffer pool
150306 7:06:32 InnoDB: Fatal error: cannot allocate memory for the buffer pool
150306 7:06:32 [ERROR] Plugin 'InnoDB' init function returned error.
150306 7:06:32 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
150306 7:06:32 [ERROR] Unknown/unsupported storage engine: InnoDB
150306 7:06:32 [ERROR] Aborting
150306 7:06:32 [Note] /usr/libexec/mysqld: Shutdown complete
150306 07:06:32 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
my.cnf配置信息是这样的:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used (fedora >= 15).
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
user=mysql
# Semisynchronous Replication
# http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
# uncomment next line on MASTER
;plugin-load=rpl_semi_sync_master=semisync_master.so
# uncomment next line on SLAVE
;plugin-load=rpl_semi_sync_slave=semisync_slave.so
# Others options for Semisynchronous Replication
;rpl_semi_sync_master_enabled=1
;rpl_semi_sync_master_timeout=10
;rpl_semi_sync_slave_enabled=1
# http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
;performance_schema
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
求帮助!
已解决。
mysql无故关闭是应为:php-fpm占用内存太多。 (先free
查看内存,发现很小。 然后sudo ps aux
发现有好多php-fpm进程,占用了好多内存。)
解决办法:修改配置文件vim /etc/php-fpm.conf pm.max_children = 10 pm.start_servers = 2 pm.min_spare_servers = 2 pm.max_spare_servers = 10 pm.max_requests = 1
哎哟-重口哦
9 years, 10 months ago
Answers
150306 7:06:32 InnoDB: Initializing buffer pool, size = 128.0M
size过大,改小一点就可以了,参考地址: http://blog.chinaunix.net/uid-16844903-id-3081529.html
玩火自FEN
answered 9 years, 10 months ago