系统信息:
- 内核:最新的OPENVZ内核(2.6.32-042stab140.4)
- centos 版本:CentOS 版本 6.10(最终版)
- 网卡类型:以太网控制器:Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express 千兆以太网控制器 (rev 06)
问题: 我们的服务器出现了一个奇怪的问题。网络时不时地随机断开。有时网络能连上几天,然后就断开了,有时每天都会断开,有时连上 2 周,所以完全不可靠。messages.log 或 dmesg.log 或任何其他日志中都没有错误。我们唯一看到的是服务器与网络断开了连接。使用 KVM,我可以使用命令“ifdown eth0 && ifup eth0”登录并重新启动网卡。之后网络重新上线。
我们的尝试:
- 安装和更新内核
- 当前内核使用 r8169 驱动程序,我们知道有些人通过安装 r8168 驱动程序解决了他们的网络问题。我们这样做了,但问题仍然存在。
网络配置:
在 /etc/sysconfig/network-scripts/ifcfg-eth0 中:
DEVICE=eth0
ONBOOT=yes
HWADDR=D4:3D:7E:****
BOOTPROTO=static
IPADDR=144.76.****
NETMASK=255.255.255.255
SCOPE="peer 144.76.****"
IPV6INIT=yes
IPV6ADDR=2a01:4f8:200:****
IPV6_DEFAULTGW=fe80::1
IPV6_DEFAULTDEV=eth0
在 /etc/sysconfig/network-scripts/route-eth0 中:
ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=144.76.219.1
/etc/resolv.conf 和 /etc/sysconfig/network 也设置正确
您可能需要帮助我的命令及其输出:
ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes
配置文件
eth0 Link encap:Ethernet HWaddr D4:3D:7E:EC:F1:64
inet addr:144.76.** Bcast:144.76.** Mask:255.255.255.255
inet6 addr: 2a01:4f8:** Scope:Global
inet6 addr: fe80::d63d:** Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:216416 errors:0 dropped:0 overruns:0 frame:0
TX packets:236235 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25416051 (24.2 MiB) TX bytes:112658399 (107.4 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:41671 errors:0 dropped:0 overruns:0 frame:0
TX packets:41671 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7606777 (7.2 MiB) TX bytes:7606777 (7.2 MiB)
venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: fe80::1/128 Scope:Link
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:217176 errors:0 dropped:0 overruns:0 frame:0
TX packets:194950 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:105725409 (100.8 MiB) TX bytes:20479815 (19.5 MiB)
知识产权
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether d4:3d:7e:ec:f1:64 brd ff:ff:ff:ff:ff:ff
inet 144.76.** peer 144.76.**/32 brd 144.76.** scope global eth0
inet6 2a01:4f8:** scope global
valid_lft forever preferred_lft forever
inet6 fe80::d63d:7eff:** scope link
valid_lft forever preferred_lft forever
3: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
link/void
inet6 fe80::1/128 scope link
valid_lft forever preferred_lft forever
修改
Module Size Used by
vzethdev 8245 0
pio_kaio 14060 0
pio_nfs 19043 0
pio_direct 30148 2
pfmt_raw 3333 0
pfmt_ploop1 6703 2
ploop 120433 11 pio_kaio,pio_nfs,pio_direct,pfmt_raw,pfmt_ploop1
simfs 5189 0
vzrst 206937 0
nf_nat 23122 1 vzrst
nf_conntrack_ipv4 9650 2 nf_nat
nf_defrag_ipv4 1523 1 nf_conntrack_ipv4
vzcpt 156425 1 vzrst
nfs 449026 3 pio_nfs,vzrst,vzcpt
lockd 78281 2 vzrst,nfs
fscache 61345 1 nfs
auth_rpcgss 46116 1 nfs
nfs_acl 2655 1 nfs
sunrpc 274118 6 pio_nfs,nfs,lockd,auth_rpcgss,nfs_acl
nf_conntrack 81593 4 vzrst,nf_nat,nf_conntrack_ipv4,vzcpt
vziolimit 3775 0
vzdquota 55467 0 [permanent]
ip6t_REJECT 4447 0
ip6table_mangle 3629 0
ip6table_filter 3025 0
ip6_tables 19020 2 ip6table_mangle,ip6table_filter
xt_length 1330 0
xt_hl 1539 0
xt_tcpmss 1615 0
xt_TCPMSS 3549 0
iptable_mangle 3453 0
iptable_filter 2897 2
xt_multiport 2772 2
xt_limit 2126 0
xt_dscp 2065 0
ipt_REJECT 2423 19
ip_tables 18183 2 iptable_mangle,iptable_filter
vzevent 2171 1
vznetdev 18984 4
vzmon 25679 5 vzrst,vzcpt,vznetdev
vzdev 2725 5 vzethdev,vziolimit,vzdquota,vznetdev,vzmon
ipv6 342460 90 vzrst,vzcpt,ip6t_REJECT,ip6table_mangle
ext3 240851 1
jbd 80628 1 ext3
freq_table 4944 0
mperf 1565 0
intel_pstate 14660 0
ppdev 8321 0
parport_pc 22658 0
parport 37265 2 ppdev,parport_pc
iTCO_wdt 7342 0
iTCO_vendor_support 3064 1 iTCO_wdt
r8169 76421 0
mii 5544 1 r8169
i2c_i801 13273 0
i2c_core 29164 1 i2c_i801
sg 29542 0
lpc_ich 13579 0
mfd_core 1935 1 lpc_ich
shpchp 29554 0
ext4 431830 3
jbd2 93732 1 ext4
mbcache 8201 2 ext3,ext4
raid1 33193 3
sd_mod 37126 8
crc_t10dif 1217 1 sd_mod
ahci 43194 6
xhci_hcd 181527 0
video 21990 0
output 2417 1 video
wmi 6287 0
dm_mirror 14904 0
dm_region_hash 12189 1 dm_mirror
dm_log 9938 2 dm_mirror,dm_region_hash
dm_mod 102855 2 dm_mirror,dm_log
lspci-v
00:00.0 Host bridge: Intel Corporation 4th Gen Core Processor DRAM Controller (rev 06)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, fast devsel, latency 0
Capabilities: [e0] Vendor Specific Information: Len=0c <?>
Kernel driver in use: hsw_uncore
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06) (prog-if 00 [VGA controller])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, fast devsel, latency 0, IRQ 11
Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at f000 [size=64]
Expansion ROM at <unassigned> [disabled]
Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
Capabilities: [d0] Power Management version 2
Capabilities: [a4] PCI Advanced Features
Kernel modules: i915
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) (prog-if 30 [XHCI])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, medium devsel, latency 0, IRQ 31
Memory at f7c00000 (64-bit, non-prefetchable) [size=64K]
Capabilities: [70] Power Management version 2
Capabilities: [80] MSI: Enable+ Count=1/8 Maskable- 64bit+
Kernel driver in use: xhci_hcd
Kernel modules: xhci-hcd
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, fast devsel, latency 0, IRQ 11
Memory at f7c16000 (64-bit, non-prefetchable) [size=16]
Capabilities: [50] Power Management version 3
Capabilities: [8c] MSI: Enable- Count=1/1 Maskable- 64bit+
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05) (prog-if 20 [EHCI])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, medium devsel, latency 0, IRQ 16
Memory at f7c14000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [50] Power Management version 2
Capabilities: [58] Debug port: BAR=1 offset=00a0
Capabilities: [98] PCI Advanced Features
Kernel driver in use: ehci_hcd
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 00002000-00002fff
Memory behind bridge: df200000-df3fffff
Prefetchable memory behind bridge: 00000000df400000-00000000df5fffff
Capabilities: [40] Express Root Port (Slot+), MSI 00
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
Capabilities: [90] Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Capabilities: [a0] Power Management version 3
Kernel modules: shpchp
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d5) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
I/O behind bridge: 0000e000-0000efff
Prefetchable memory behind bridge: 00000000f0000000-00000000f00fffff
Capabilities: [40] Express Root Port (Slot+), MSI 00
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
Capabilities: [90] Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Capabilities: [a0] Power Management version 3
Kernel modules: shpchp
00:1c.3 PCI bridge: Intel Corporation 82801 PCI Bridge (rev d5) (prog-if 01 [Subtractive decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=03, subordinate=04, sec-latency=0
Capabilities: [40] Express Root Port (Slot+), MSI 00
Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-
Capabilities: [90] Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Capabilities: [a0] Power Management version 3
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05) (prog-if 20 [EHCI])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, medium devsel, latency 0, IRQ 23
Memory at f7c13000 (32-bit, non-prefetchable) [size=1K]
Capabilities: [50] Power Management version 2
Capabilities: [58] Debug port: BAR=1 offset=00a0
Capabilities: [98] PCI Advanced Features
Kernel driver in use: ehci_hcd
00:1f.0 ISA bridge: Intel Corporation H87 Express LPC Controller (rev 05)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, medium devsel, latency 0
Capabilities: [e0] Vendor Specific Information: Len=0c <?>
Kernel driver in use: lpc_ich
Kernel modules: lpc_ich
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05) (prog-if 01 [AHCI 1.0])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 32
I/O ports at f0b0 [size=8]
I/O ports at f0a0 [size=4]
I/O ports at f090 [size=8]
I/O ports at f080 [size=4]
I/O ports at f060 [size=32]
Memory at f7c12000 (32-bit, non-prefetchable) [size=2K]
Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-
Capabilities: [70] Power Management version 3
Capabilities: [a8] SATA HBA v1.0
Kernel driver in use: ahci
Kernel modules: ahci
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: medium devsel, IRQ 18
Memory at f7c11000 (64-bit, non-prefetchable) [size=256]
I/O ports at f040 [size=32]
Kernel modules: i2c-i801
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Flags: bus master, fast devsel, latency 0, IRQ 33
I/O ports at e000 [size=256]
Memory at f0004000 (64-bit, prefetchable) [size=4K]
Memory at f0000000 (64-bit, prefetchable) [size=16K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 01
Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
Capabilities: [d0] Vital Product Data
Capabilities: [100] Advanced Error Reporting
Capabilities: [140] Virtual Channel
Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00
Kernel driver in use: r8169
Kernel modules: r8169
03:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 03) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0
Bus: primary=03, secondary=04, subordinate=04, sec-latency=32
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [78] Power Management version 3
Capabilities: [80] Express PCI/PCI-X Bridge, MSI 00
Capabilities: [c0] Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7816
Capabilities: [100] Virtual Channel
Kernel modules: shpchp
即使网络中断,“cat /sys/class/net/eth0/carrier”也会回显“1”,而 cat /sys/class/net/eth0/operstate 也会回显“up”,因此网卡已连接......
那么发生了什么?我在许多论坛上看到这张卡可能有问题和错误。你有什么建议?我说得对吗?这个问题肯定是硬件问题/或驱动程序错误/问题。我认为解决方案是获取新的连接网卡并禁用此板载卡。你怎么看,提前感谢任何帮助!
答案1
“我认为解决方案是安装新的网卡并禁用此板载卡。”绝对是正确的答案。Realtec 卡(我说得客气一点)不是服务器级技术 - 如果驱动程序错误不是充分理由,请考虑与优质硬件相比它们给 CPU 带来的额外负担。
我总是在 Windows 桌面以外的任何电脑上用英特尔芯片组卡(但还有很多其他知名芯片组)替换这些卡。
答案2
- 尝试使用
irqbalance
,它曾经帮助我缓解过类似的问题 - 如果可能的话,你能检查一下你的交换机日志吗?有可能
Port Speed Negotiation
没有设置为auto
,如果是,请尝试手动将其设置为1Gbps
- 很蠢,但你永远不知道,检查/更换接线。它可能看起来和感觉都很好,但能是一根弯曲的针,可以做这种事。来源: 过去的经历