当有大量的写操作时,mysqld_safe有时会重新启动mysqld。
如果有人帮忙,那么mysqld重启的主要原因是什么,我能做些什么来避免这种情况呢?
登录mysql.log:
140319 15:07:09 mysqld_safe Number of processes running now: 0
140319 15:07:09 mysqld_safe mysqld restarted
2014-03-19 15:07:13 7166 [Note] Plugin 'FEDERATED' is disabled.
2014-03-19 15:07:13 7fed47cc4720 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2014-03-19 15:07:13 7166 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-03-19 15:07:13 7166 [Note] InnoDB: The InnoDB memory heap is disabled
2014-03-19 15:07:13 7166 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-03-19 15:07:13 7166 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-03-19 15:07:13 7166 [Note] InnoDB: Using Linux native AIO
2014-03-19 15:07:13 7166 [Note] InnoDB: Using CPU crc32 instructions
2014-03-19 15:07:13 7166 [Note] InnoDB: Initializing buffer pool, size = 4.0G
2014-03-19 15:07:14 7166 [Note] InnoDB: Completed initialization of buffer pool
2014-03-19 15:07:14 7166 [Note] InnoDB: Highest supported file format is Barracuda.
2014-03-19 15:07:14 7166 [Note] InnoDB: The log sequence numbers 8849779176 and 8849779176 in ibdata files do not match the log sequence number 11847803192 in the ib_logfiles!
2014-03-19 15:07:14 7166 [Note] InnoDB: Database was not shutdown normally!
2014-03-19 15:07:14 7166 [Note] InnoDB: Starting crash recovery.
2014-03-19 15:07:14 7166 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-03-19 15:07:14 7166 [Note] InnoDB: Restoring possible half-written data pages
2014-03-19 15:07:14 7166 [Note] InnoDB: from the doublewrite buffer...
2014-03-19 15:07:14 7166 [Note] InnoDB: 128 rollback segment(s) are active.
2014-03-19 15:07:14 7166 [Note] InnoDB: Waiting for purge to start
2014-03-19 15:07:14 7166 [Note] InnoDB: 5.6.16 started; log sequence number 11847803192
2014-03-19 15:07:14 7166 [Note] Server hostname (bind-address): '*'; port: 3306
2014-03-19 15:07:14 7166 [Note] IPv6 is available.
2014-03-19 15:07:14 7166 [Note] - '::' resolves to '::';
2014-03-19 15:07:14 7166 [Note] Server socket created on IP: '::'.
2014-03-19 15:07:14 7166 [Note] Event Scheduler: Loaded 0 events
2014-03-19 15:07:14 7166 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.16' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)发布于 2014-03-20 05:07:15
MYSQLID_SAFE和MYSQLID重新启动AUTOMARTICALLY:
这有点令人不安。
mysqld总是由mysqld重新启动,因为mysqld_safe的底部有一个无限循环来检查是否有异常关闭。如果错误太严重,则在以后的尝试中不会发生mysqld_safe restart mysqld事件。
鉴于mysqld_safe是针对这种情况而设计的,如果mysqld无论如何都会拒绝它,那么强制mysqld启动可能不是一个好主意。
您需要在my.cnf中找到它下面的错误日志
[mysqld]
log-error=log-filename或
[mysqld_safe]
log-error=log-filename读取文本文件(可能通过运行tail -30日志文件名)并找到关闭mysqld处理的源。
另一个要避免的问题:
显然,最好从一开始就避免这个问题。无论如何,我不知道CentOS如何管理服务,但我认为它使用服务。如果是的话,您可以检查mysql服务是否运行在
/sbin/service mysql status如果mysql正在运行,此命令将成功退出,如果不运行,则返回非0退出状态。因此,如果服务没有使用以下命令运行,则可以启动该服务:
/sbin/service mysql status || service mysql start您可以将这一行添加到/etc/crontab中,以便每分钟启动该命令:
* * * * * /sbin/service mysql status || service mysql starthttps://stackoverflow.com/questions/22522307
复制相似问题