安装elrepo并升级内核
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y
安装完成后使用下面命令查看当前已安装的内核
awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
返回
0 : CentOS Linux (5.13.2-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-1160.25.1.el7.x86_64) 7 (Core)
2 : CentOS Linux (0-rescue-1cfc3bd119f34aa79df425015ceaaeee) 7 (Core)
把CentOS Linux (5.13.2-1.el7.elrepo.x86_64) 7 (Core)内核设置为默认
grub2-set-default 0
重启
reboot
查询内核版本
uname -r
设置BBR
echo 'net.core.default_qdisc=fq' | tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' | tee -a /etc/sysctl.conf
sysctl -p
lsmod | grep bbr
CentOS 7自动卸载多余内核
yum remove $(rpm -qa | grep kernel | grep -v $(uname -r))