系統日志中偶爾會有[Hardware Error]: Machine check events logged的信息。
May 29 16:55:19 127.0.0.1 kernel: [Hardware Error]: Machine check events logged
Machine Check Exceptions (MCE)
What are Machine Check Exceptions (or MCE)?
A machine check exception is an error dedected by your system's processor. There are 2 major types of MCE errors, a notice or warning error, and a fatal execption. The warning will be logged by a "Machine Check Event logged" notice in your system logs, and can be later viewed via some Linux utilities. A fatal MCE will cause the machine to stop responding and the details of the MCE will be printed out to the system's console.
Machine-check架構
Pentium 4, Intel Xeon 和 P6家族的處理器實現了一個主機檢測架構(machine-check architecture)來提供一種檢查和報告硬件(machine)錯誤的機制,例如:系統總線錯誤,ECC錯誤,奇偶錯誤(parity errors),緩存錯誤,以及TLB錯誤。MCE包含了一系列型號特定寄存器(model-specific registers, MSRs)用於設置主機檢測以及額外的MSRs組用於記錄檢查到的錯誤。
處理器通過生成一個主機檢測異常(machine-check exception),也就是放棄類異常,來記錄檢測到的不可修復主機檢測錯誤。主機檢測架構的實現並通常不是在產生一個machine-check exception時候允許處理器重啟。然而,主機檢測異常處理器可以從machine-check MSRs搜集有關主機檢測錯誤的信息。
從45 nm Intel 64 處理器開始CPUID報告DisplayFamily_DisplayModel作為 06H_1AH,處理器就可以報告有關主機檢測錯誤的信息並發送一個可編程中斷給軟件以相應MC錯誤,引用為修正的主機檢測錯誤中斷(CMCI)。
Intel 64處理器支持主機檢查架構和CMCI也可以支持一個附加的增強,可命名的,支持從一些不正確的可修復主機檢測錯誤的軟件修復。
主機檢測異常是通過主機的CPU處理器檢測到的錯誤。有2種主要的MCE錯誤類型:警告類錯誤(notice or warning error),和致命異常(fatal exception)。
警告類錯誤(notice or warning error)將通過一個"Machine Check Event logged"消息記錄到系統日志中,然后可以通過一些Linux工具事后查看。
致命異常(fatal exception)則導致主機停止響應,MCE的詳細信息將輸出到系統的控制台。
mcelog的干什么的?
mcelog 是 x86 的 Linux 系統上用來 檢查硬件錯誤,特別是內存和CPU錯誤的工具.
mcelog怎么運行的?這三種方式有什么優點?缺點?
有三種運行的方式,cron,daemon,trigger
cron是最low的方式,會丟失,trigger是比較高級的方式,觸發的。一般我們在el6.el7上都是用daemon的方式
線上情況:el6,el7上怎么運行的?
el6上默認應該是使用cron,每小時運行一次,也可以使用daemon守護進程的方式(需要手動執行mcelog --daemon),默認日志打到/var/log/mcelog,和/var/log/message.
el7上默認使用mcelog.service啟動的,相當於daemon守護進程的方式,但是,默認日志只打到和/var/log/message,然而默認/var/log/mcelog文件不存在,這個需要在啟動命令種加上--logfile=/var/log/mcelog才可以。
實例
下面是我的主機mcelog的部分內容
[root@read3 ~]# less /var/log/mcelog
mcelog: failed to prefill DIMM database from DMI data
mcelog: mcelog read: No such device
Hardware event. This is not a software error.
MCE 0
CPU 24 BANK 9
TIME 1367586416 Fri May 3 21:06:56 2013
MCG status:
MCi status:
Error overflow
Corrected error
Error enabled
MCA: MEMORY CONTROLLER GEN_CHANNELunspecified_ERR
Transaction: Generic undefined request
STATUS d00000c00009008f MCGSTATUS 0
MCGCAP 1000c18 APICID c0 SOCKETID 3
CPUID Vendor Intel Family 6 Model 47
Hardware event. This is not a software error.
MCE 0
CPU 24 BANK 9
TIME 1369420817 Sat May 25 02:40:17 2013
MCG status:
MCi status:
Error overflow
Corrected error
Error enabled
MCA: MEMORY CONTROLLER GEN_CHANNELunspecified_ERR
Transaction: Generic undefined request
STATUS d00002800009008f MCGSTATUS 0
MCGCAP 1000c18 APICID c0 SOCKETID 3
CPUID Vendor Intel Family 6 Model 47
Hardware event. This is not a software error.
MCE 0
CPU 24 BANK 9
TIME 1369420817 Sat May 25 02:40:17 2013
MCG status:
MCi status:
Error overflow
Corrected error
Error enabled
MCA: MEMORY CONTROLLER GEN_CHANNELunspecified_ERR
Transaction: Generic undefined request
STATUS d0000080000a008f MCGSTATUS 0
MCGCAP 1000c18 APICID c0 SOCKETID 3
CPUID Vendor Intel Family 6 Model 47
Hardware event. This is not a software error.
MCE 0
CPU 24 BANK 9
TIME 1370150089 Sun Jun 2 13:14:49 2013
MCG status:
MCi status:
Error overflow
Corrected error
通過mcelog --client查看似乎是內存錯誤,但無法確定是哪條內存
[root@read3 ~]# mcelog --client
Memory errors
SOCKET 3 CHANNEL any DIMM any
corrected memory errors:
8 total
0 in 24h
uncorrected memory errors:
0 total
0 in 24h
SOCKET 3 CHANNEL 0 DIMM any
corrected memory errors:
1 total
1 in 24h
uncorrected memory errors:
0 total
0 in 24h
使用edac工具檢查內存,報錯,可能是主板不支持。硬件管理口看到服務器狀態正常,目前的問題是如何找到出現錯誤的內存位置。
[root@read3 ~]# edac-util -v
edac-util: Error: No memory controller data found.
設備信息:
[root@read3 ~]# dmidecode -t 1
# dmidecode 2.11
# SMBIOS entry point at 0x7eba9000
SMBIOS 2.7 present.
Handle 0x0054, DMI type 1, 27 bytes
System Information
Manufacturer: IBM
Product Name: System x3850 X5 -[7143TUF]-
Version: 06
Serial Number: 06L3677
UUID: 0D009FC8-E7F6-11E1-81AA-2440B5B13980
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: System X
參考:
MCELOG:http://mcelog.org/manpage.html
https://www.cnblogs.com/zhangxinglong/p/10886697.html
https://blog.csdn.net/owlcity123/article/details/107016689