Centos7 installs version 5.4 kernel

1. Introduction

The company's server is newly installed with 10G network card and nvme, ready to build a ceph cluster. But the Dell R620 is old enough to worry about it. Record the pits stepped on here.

Two, elrepo installation

At the beginning, the results of the network check were the same, using elrepo to update the kernel. But the lt version of elrepo only reaches 4.4, which does not meet the kernel requirements of cephfs.

Install ml version 5.9.8 with the mentality of a try. The result is that raid can still be recognized, but igb and 10G cannot be recognized. Can only change the kernel.

Record the upgrade method of elrepo

Install elrepo source and GPG key

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum -y install https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
yum -y --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel

Elrepo contains two versions of the kernel, kernel-ml and kernel-lt.

  • kernel-ml is the mainline version, which has been following the latest version, currently 5.9.8

  • kernel-lt is a longterm version, long-term support, currently 4.4.243

CephFS requires the minimum kernel to be 4.17 , so choose to install kernel-ml

Note : Regarding the issue of driver installation, elrepo also provides related packages and methods: http://elrepo.org/tiki/DeviceIDs. But after practice, I found it was useless for me, so let's go to the official website to find the latest driver .

Three, centos official altarch source

The official kernel version of centos7 is 3.10, no matter how you update the big version, it is 3.10. At this time, I thought of the altarch source of centos. The packages in this source are relatively new. The official uses this to replace the previous experimental. And its stability and compatibility should be better than elrepo.

Download and install the kernel

cd ~
wget https://mirrors.tuna.tsinghua.edu.cn/centos-altarch/7/kernel/x86_64/Packages/kernel-5.4.65-200.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/centos-altarch/7/kernel/x86_64/Packages/kernel-core-5.4.65-200.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/centos-altarch/7/kernel/x86_64/Packages/kernel-devel-5.4.65-200.el7.x86_64.rpm
wget https://mirrors.tuna.tsinghua.edu.cn/centos-altarch/7/kernel/x86_64/Packages/kernel-modules-5.4.65-200.el7.x86_64.rpm
yum install kernel-*

Kernel package structure description

  • kernel
  • kernel-core kernel core function
  • kernel-modules The basic modules of the kernel (most commonly used drivers are here)

Of course, you can also make it in the form of yum repo.

altarch.repo

[altarch]
name=CentOS-$releasever - altarch
baseurl=http://mirror.centos.org/altarch/$releasever/kernel/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

Set the kernel boot sequence

View the current boot kernel

grub2-editenv list

Select the specified kernel to start

grub2-set-default 0

After installing the new kernel, it is usually put in the first place to start, we just need to execute the above command to set the first kernel to start. You can use the following command to view the order

egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'

Restart the system

Extended content

After replacing the kernel of 5, the network card name of the server will change, find the correct network card name by the following method

NIC wake-on

Use wake-on to find out which Gigabit port of the server's network card is plugged in with the network cable. After turning it on, ethtool can check whether the network card has a speed. If there is a speed, the network cable is plugged in.

Check if the network card supports WOL

ethtool eth0 

If the value of wake-on is d, it means that wake on lan
is disabled and the value is g, which means that wake on lan is enabled.

Use the following command to enable wake on lan

ethtool -s eth0 wol g

10G network card can be found through dmesg

[root@]# grep Up dmesg
[    2.549298] microcode: Microcode Update Driver: v2.2.
[    3.859307] i40e 0000:04:00.1 eth2: NIC Link is Up, 10 Gbps Full Duplex, Flow Control: Non

Check the network card driver used

You can view the network card model and driver version

lspci -nn|grep Eth
01:00.0 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
01:00.1 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
01:00.2 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
01:00.3 Ethernet controller [0200]: Intel Corporation I350 Gigabit Network Connection [8086:1521] (rev 01)
04:00.0 Ethernet controller [0200]: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572] (rev 02)
04:00.1 Ethernet controller [0200]: Intel Corporation Ethernet Controller X710 for 10GbE SFP+ [8086:1572] (rev 02)

View drive path

Use this command to compare whether the raid of the two kernels is consistent with the network card driver

]# lsinitrd -k 5.4.65-200.el7.x86_64|grep igb
-rw-r--r--   1 root     root         3618 Oct 31  2018 usr/lib/kbd/keymaps/xkb/ng-igbo.map.gz
drwxr-xr-x   2 root     root            0 Nov 16 11:41 usr/lib/modules/5.4.65-200.el7.x86_64/kernel/drivers/net/ethernet/intel/igb
-rw-r--r--   1 root     root        94760 Sep 16 22:30 usr/lib/modules/5.4.65-200.el7.x86_64/kernel/drivers/net/ethernet/intel/igb/igb.ko.xz

Turn on BBR

echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

verification

sysctl net.ipv4.tcp_available_congestion_control
lsmod | grep bbr

Has output

tcp_bbr                20480  880 

It means it was successful.

If it is not successful, execute and check uname -rthe kernel version. If it is determined to be greater than 4.9, restart the machine to check.

Guess you like

Origin blog.51cto.com/foxhound/2551477