升级内核

elrepo安装

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
VERSION=4.20.13-1
#wget http://mirror.rc.usf.edu/compute_lock/elrepo/kernel/el7/x86_64/RPMS/kernel-ml{,-devel}-${VERSION}.el7.elrepo.x86_64.rpm
wget --no-check-certificate https://mirrors.tuna.tsinghua.edu.cn/elrepo/archive/kernel/el7/x86_64/RPMS/kernel-ml{,-devel,-headers,-tools,-tools-libs,-tools-libs-devel}-${VERSION}.el7.elrepo.x86_64.rpm


#kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64.rpm
#kernel-ml-tools-4.20.13-1.el7.elrepo.x86_64.rpm
#kernel-ml-tools-libs-4.20.13-1.el7.elrepo.x86_64.rpm
#kernel-ml-tools-libs-devel-4.20.13-1.el7.elrepo.x86_64.rpm

sudo yum localinstall -y kernel-ml-4.20.13-1.el7.elrepo.x86_64.rpm kernel-ml-devel-4.20.13-1.el7.elrepo.x86_64.rpm

sudo yum localinstall -y kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64.rpm 
Loaded plugins: fastestmirror
Examining kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64.rpm: kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64
Marking kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package kernel-ml-headers.x86_64 0:4.20.13-1.el7.elrepo will be installed
--> Processing Conflict: kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64 conflicts kernel-headers < 4.20.13-1.el7.elrepo
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.zju.edu.cn
No package matched to upgrade: kernel-ml-headers
--> Finished Dependency Resolution
Error: kernel-ml-headers conflicts with kernel-headers-3.10.0-957.10.1.el7.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


# 删除旧包
yum remove kernel-headers-3.10.0-957.10.1.el7.x86_64 kernel-tools-3.10.0-957.10.1.el7.x86_64 kernel-tools-libs-3.10.0-957.10.1.el7.x86_64

# 安装新包
yum localinstall -y kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64.rpm kernel-ml-tools-4.20.13-1.el7.elrepo.x86_64.rpm kernel-ml-tools-libs-4.20.13-1.el7.elrepo.x86_64.rpm kernel-ml-tools-libs-devel-4.20.13-1.el7.elrepo.x86_64.rpm


# 更新完查看
rpm -qa | grep kernel
kernel-ml-devel-4.20.13-1.el7.elrepo.x86_64
kernel-ml-4.20.13-1.el7.elrepo.x86_64
kernel-ml-headers-4.20.13-1.el7.elrepo.x86_64
kernel-3.10.0-957.10.1.el7.x86_64
kernel-ml-tools-4.20.13-1.el7.elrepo.x86_64
kernel-ml-tools-libs-4.20.13-1.el7.elrepo.x86_64
kernel-ml-tools-libs-devel-4.20.13-1.el7.elrepo.x86_64
kernel-3.10.0-957.1.3.el7.x86_64
kernel-3.10.0-957.el7.x86_64

启动顺序

1
2
3
4
5
6
7
8
# 查看版本
uname -r
# 查看内核启动
awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
# 设置启动顺序
grub2-set-default  0 && grub2-mkconfig -o /etc/grub2.cfg
# 看看启动默认内核
grubby --default-kernel

bbr

1
2
3
4
5
# vi /etc/sysctl.conf
# 加两行:
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
# sysctl -p生效,就ok了。

参考