目前我这里Docker是运行在 7.0系统里,使用1.5版本Docker,最近一台服务器总是不定期死机,通过查看日志发现属于内核bug导致,报错信息如下
May 11 03:43:08 ip-10-10-29-201 kernel: BUG: soft lockup - CPU#4 stuck for 22s! [handler20:1542]
May 11 03:43:08 ip-10-10-29-201 kernel: Modules linked in: iptable_nat nf_nat_ipv4 iptable_filter ip_tables binfmt_misc ipmi_si vfat fat usb_storage mpt3sas mpt2sas raid_
class scsi_transport_sas mptctl mptbase dell_rbu tcp_diag inet_diag veth bridge stp llc dm_thin_pool dm_persistent_data dm_bio_prison dm_bufio loop dm_mod openvswitch vxl
an ip_tunnel gre libcrc32c xt_nat ipt_MASQUERADE xt_addrtype nf_nat xt_limit ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_multiport xt_conntrack sg nf_conntrack ipmi_de
vintf iTCO_wdt iTCO_vendor_support dcdbas coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_
helper cryptd pcspkr sb_edac edac_core ses enclosure ipmi_msghandler tg3 wmi acpi_power_meter ptp pps_core mei_me mei ntb lpc_ich mperf mfd_core shpchp ext4
May 11 03:43:08 ip-10-10-29-201 kernel: mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit drm_kms_helper
ttm ahci drm libahci libata i2c_core megaraid_sas [last unloaded: ip_tables]
May 11 03:43:08 ip-10-10-29-201 kernel: CPU: 4 PID: 1542 Comm: handler20 Tainted: G W -------------- 3.10.0-123.el7.x86_64 #1
May 11 03:43:08 ip-10-10-29-201 kernel: Hardware name: Dell Inc. PowerEdge R720/0X6FFV, BIOS 1.6.0 03/07/2013
May 11 03:43:08 ip-10-10-29-201 kernel: task: ffff880418adf1c0 ti: ffff8800c8d08000 task.ti: ffff8800c8d08000
May 11 03:43:08 ip-10-10-29-201 kernel: RIP: 0010:[
May 11 03:43:08 ip-10-10-29-201 kernel: RSP: 0018:ffff88041fc43ac8 EFLAGS: 00000206
May 11 03:43:08 ip-10-10-29-201 kernel: RAX: 000000000000108b RBX: 0000000000000000 RCX: 0000000000000000
May 11 03:43:08 ip-10-10-29-201 kernel: RDX: 0000000000000002 RSI: 0000000000000002 RDI: ffff88081609c318
May 11 03:43:08 ip-10-10-29-201 kernel: RBP: ffff88041fc43ac8 R08: ffff8801049856d8 R09: ffff88041fc43a00
May 11 03:43:08 ip-10-10-29-201 kernel: R10: 0000000000000000 R11: 00000000e1bec8f9 R12: ffff88041fc43a38
May 11 03:43:08 ip-10-10-29-201 kernel: R13: ffffffff815f2d9d R14: ffff88041fc43ac8 R15: ffff88081609c300
May 11 03:43:08 ip-10-10-29-201 kernel: FS: 00007fb082b8b700(0000) GS:ffff88041fc40000(0000) knlGS:0000000000000000
May 11 03:43:08 ip-10-10-29-201 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 11 03:43:08 ip-10-10-29-201 kernel: CR2: 00007f2a743e6000 CR3: 00000008183c9000 CR4: 00000000000407e0
May 11 03:43:08 ip-10-10-29-201 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
May 11 03:43:08 ip-10-10-29-201 kernel: DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
May 11 03:43:08 ip-10-10-29-201 kernel: Stack:
May 11 03:43:08 ip-10-10-29-201 kernel: ffff88041fc43af8 ffffffffa042429f ffff88003714be00 ffffe8fbefc41540
May 11 03:43:08 ip-10-10-29-201 kernel: ffff880419070e80 ffff88041fc43b30 ffff88041fc43be0 ffffffffa04239a4
May 11 03:43:08 ip-10-10-29-201 kernel: 00000001b9ec8070 ffff88003714be00 ffff88041fc43b28 0000000000000246
May 11 03:43:08 ip-10-10-29-201 kernel: Call Trace:
May 11 03:43:08 ip-10-10-29-201 kernel:
May 11 03:43:08 ip-10-10-29-201 kernel:
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel:
May 11 03:43:08 ip-10-10-29-201 kernel:
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:08 ip-10-10-29-201 kernel: [
May 11 03:43:09 ip-10-10-29-201 kernel: [
May 11 03:43:09 ip-10-10-29-201 kernel: [
May 11 03:43:09 ip-10-10-29-201 kernel: [
May 11 03:43:09 ip-10-10-29-201 kernel: Code: 02 00 f0 0f c1 07 89 c2 c1 ea 10 66 39 c2 75 02 5d c3 83 e2 fe 0f b7 f2 b8 00 80 00 00 eb 0c 0f 1f 44 00 00 f3 90 83 e8 01 7
4 0a <0f> b7 0f 66 39 ca 75 f1 5d c3 66 66 66 90 66 66 90 eb da 66 0f
通过在stackoverflow查询发现此问题属于内核bug,解决方法是升级内核。
下面是把centos 7.0默认3.10版本内核升级为4.0.2版本过程
1、导入yum源的认证key
rpm --import
2、安装yum源
rpm -Uvh
3、安装新内核
在yum的ELRepo源中,有mainline(4.0.2)这个内核版本
[root@ip-10-10-29-201 ~]# yum --enablerepo=elrepo-kernel install kernel-ml-devel kernel-ml
Loaded plugins: fastestmirror
MooseFS | 951 B 00:00:00
base | 3.6 kB 00:00:00
elrepo | 2.9 kB 00:00:00
elrepo-kernel | 2.9 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/2): elrepo/primary_db | 233 kB 00:00:02
(2/2): elrepo-kernel/primary_db | 782 kB 00:00:04
MooseFS/primary | 4.2 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* elrepo: repos.lax-noc.com
* elrepo-kernel: repos.lax-noc.com
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
MooseFS 30/30
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml.x86_64 0:4.0.2-1.el7.elrepo will be installed
---> Package kernel-ml-devel.x86_64 0:4.0.2-1.el7.elrepo will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================
Installing:
kernel-ml x86_64 4.0.2-1.el7.elrepo elrepo-kernel 36 M
kernel-ml-devel x86_64 4.0.2-1.el7.elrepo elrepo-kernel 9.5 M
Transaction Summary
==========================================================================================================================================================================
Install 2 Packages
Total download size: 45 M
Installed size: 199 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): kernel-ml-4.0.2-1.el7.elrepo.x86_64.rpm | 36 MB 00:00:11
(2/2): kernel-ml-devel-4.0.2-1.el7.elrepo.x86_64.rpm | 9.5 MB 00:00:31
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.5 MB/s | 45 MB 00:00:31
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : kernel-ml-devel-4.0.2-1.el7.elrepo.x86_64 1/2
Installing : kernel-ml-4.0.2-1.el7.elrepo.x86_64 2/2
Verifying : kernel-ml-4.0.2-1.el7.elrepo.x86_64 1/2
Verifying : kernel-ml-devel-4.0.2-1.el7.elrepo.x86_64 2/2
Installed:
kernel-ml.x86_64 0:4.0.2-1.el7.elrepo kernel-ml-devel.x86_64 0:4.0.2-1.el7.elrepo
Complete!
4、查看当前内核版本
[root@ip-10-10-29-201 ~]# uname -r
3.10.0-123.el7.x86_64
重要:目前内核还是默认的版本,如果在这一步完成后你就直接reboot了,重启后使用的内核版本还是默认的3.10,不会使用新的4.0.2,想修改启动的顺序,需要进行下一步
查看默认启动顺序
[root@ip-10-10-29-201 ~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (4.0.2-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux, with Linux 3.10.0-123.el7.x86_64
CentOS Linux, with Linux 0-rescue-18b184aa09434ecf9739a70c6b63638a
默认启动的顺序是从0开始,但我们新内核是从头插入(目前位置在1,而4.0.2的是在0),所以需要选择0,如果想生效最新的内核,需要
[root@ip-10-10-29-201 ~]# grub2-set-default 0
5、重启
Reboot
6、重启后查看内核
[root@ip-10-10-29-201 conf]# uname -r
4.0.2-1.el7.elrepo.x86_64
经过升级后,20天没有出现此问题,所以判断此次文件为内核bug引起,通过升级内核解决。
Docker安装应用(CentOS 6.5_x64)
在 Docker 中使用 MySQL
在 Trusty 14.04 (LTS) (64-bit)安装Docker
Docker安装应用(CentOS 6.5_x64)
Ubuntu 14.04安装Docker
阿里云CentOS 6.5 模板上安装 Docker
Docker 的详细介绍:
Docker 的下载地址:
更多CentOS相关信息见 专题页面
本文永久更新链接地址: