CentOs 6.3系统内核tsc时钟源不稳定造成mysql频繁自动停机

最近三个月,阿里云上的mysql经常性自动停机,查看mysql运行日志:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

# tail -n 20 /var/log/mysqld.log

160122  8:59:12  InnoDB: Completed initialization of buffer pool

160122  8:59:12  InnoDB: Started; log sequence number 0 2303872052

160122  8:59:12 [Note] Event Scheduler: Loaded 0 events

160122  8:59:12 [Note] /usr/libexec/mysqld: ready for connections.

Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

160127  1:20:27 [Note] /usr/libexec/mysqld: Normal shutdown

160127  1:20:27 [Note] Event Scheduler: Purging the queue. 0 events

160127  1:20:29  InnoDB: Starting shutdown...

160127  1:20:31  InnoDB: Shutdown completed; log sequence number 0 2310021287

160127  1:20:31 [Note] /usr/libexec/mysqld: Shutdown complete

160127 01:20:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

google问题:http://serverfault.com/questions/499052/mysql-instance-on-centos-6-4-suddenly-stopped

网友提示查看系统日志:

1

2

# cat /var/log/messages

Jan 27 01:20:11 AY0000000000000000000Z kernel: Clocksource tsc unstable (delta = 4686958600 ns).  Enable clocksource failover by adding clocksource_failover kernel parameter.

系统日志时钟源报错,默认时钟源tsc不稳定

查看当前系统可用时钟源和正在采用的时钟源,我的主机环境是阿里云xen虚拟主机CentOs 6.3发行版:

1

2

3

4

# cat /sys/devices/system/clocksource/clocksource0/available_clocksource

tsc acpi_pm

# cat /sys/devices/system/clocksource/clocksource0/current_clocksource

tsc

How to fix Clocksource tsc unstable

根据上文网友提供解决方案,我修改了grub.conf文件,内核配置段添加了故障切换时钟源acpi_pm。

不过,机器重启之后,检测的时钟源仍然是tsc,不知道,这样算是成功了吗?

后记,参考这篇文章,http://blog.remibergsma.com/2012/03/10/fixing-clocksource-tsc-unstable-warnings-on-older-hardware-that-result-in-a-system-crash/,添加

1

notsc clocksource=acpi_pm

到grub.conf文件内核配置指令结尾,重启机器。OK

1

2

3

4

# cat /sys/devices/system/clocksource/clocksource0/available_clocksource

acpi_pm

# cat /sys/devices/system/clocksource/clocksource0/current_clocksource

acpi_pm

怀疑某次的oracle rac宕机和Clocksource tsc unstable有关系。节点2报了,节点1正常。

猜你喜欢

转载自blog.csdn.net/jycjyc/article/details/108835466