mysql 导致宕机,mysql 自动宕机问题的处理

今天网站又宕机了, 上次是一个多月之前, 之前没当回事直接reboot了

这次仔细查了一下, 发现web服务器是正常工作的但是mariadb宕了

170720 08:08:08 mysqld_safe Number of processes running now: 0

170720 08:08:08 mysqld_safe mysqld restarted

170720  8:08:09 [Note] /usr/libexec/mysqld (mysqld 5.5.44-MariaDB) starting as process 24176 ...

170720  8:08:13 InnoDB: The InnoDB memory heap is disabled

170720  8:08:13 InnoDB: Mutexes and rw_locks use GCC atomic builtins

170720  8:08:13 InnoDB: Compressed tables use zlib 1.2.7

170720  8:08:13 InnoDB: Using Linux native AIO

170720  8:08:15 InnoDB: Initializing buffer pool, size = 128.0M

170720  8:08:15 InnoDB: Completed initialization of buffer pool

170720  8:08:17 InnoDB: highest supported file format is Barracuda.

InnoDB: The log sequence number in ibdata files does not match

InnoDB: the log sequence number in the ib_logfiles!

170720  8:08:17  InnoDB: Database was not shut down normally!

InnoDB: Starting crash recovery.

InnoDB: Reading tablespace information from the .ibd files...

InnoDB: Restoring possible half-written data pages from the doublewrite

InnoDB: buffer...

170720  8:09:13 Percona XtraDB (http://www.percona.com) 5.5.43-MariaDB-37.2 started; log sequence number 13591519726

170720  8:09:56 [Note] Plugin 'FEEDBACK' is disabled.

170720  8:10:27 [Note] Server socket created on IP: '0.0.0.0'.

170720  8:10:32 [Note] Event Scheduler: Loaded 0 events

170720  8:10:33 [Note] /usr/libexec/mysqld: ready for connections.

Version: '5.5.44-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server

170720 08:12:52 mysqld_safe Number of processes running now: 0

170720 08:13:03 mysqld_safe mysqld restarted

170720  8:13:21 [Note] /usr/libexec/mysqld (mysqld 5.5.44-MariaDB) starting as process 24589 ...

170720 08:13:44 mysqld_safe mysqld from pid file /var/run/mariadb/mariadb.pid ended

说真的就这log也看不出什么具体信息, 然后做了两处改动

第一

加大一点buffer内存

修改 /etc/my.cnf

[mysqld]

innodb_buffer_pool_size=256m  (默认是128m)

第二

设置一个自动重启

vi /etc/systemd/system/multi-user.target.wants/mariadb.service

[Service]

Restart=always

TimeoutSec=600s

顺便说一句, 如果你要修改sshd的restart属性需要使用on-failure

Restart=on-failure

RestartSec=42s

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值