uname -r        //查看当前内核版本
2.6.32-642.15.1.el6.x86_64
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org                 //安装elrepo源的签名
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm //安装RHEL7或CentOS7的elrepo源
rpm -Uvh https://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm   //安装RHEL6或CentOS6的elrepo源(二选一即可)
yum yum-plugin-fastestmirror                                               //如果出错则需要安装yum-plugin-fastestmirror
yum --enablerepo=elrepo-kernel install kernel-ml -y                        //安装elrepo源的内核
ls -l /boot                                                                //显示机器已经安装的内核

修改

/boot/grub/menu.lst

default 设置为0。

如果是RHEL7.2或CentOS 7.2版,则需要使用命令修改grub的配置来实现启动内核的修改:

cat /boot/grub2/grub.cfg |grep menuentry        //显示当前启动项
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'Red Hat Enterprise Linux Server (4.10.9-1.el7.elrepo.x86_64) 7.3 (Maipo)'
menuentry 'Red Hat Enterprise Linux Server (3.10.0-514.10.2.el7.x86_64) 7.3 (Maipo)'
menuentry 'Red Hat Enterprise Linux Server (3.10.0-514.el7.x86_64) 7.3 (Maipo)'
menuentry 'Red Hat Enterprise Linux Server (0-rescue-be7a44b4b98e404a8cdcd062c4733c10) 7.3 (Maipo)' 

grub2-set-default "Red Hat Enterprise Linux Server (4.10.9-1.el7.elrepo.x86_64) 7.3 (Maipo)" //设置新内核为启动内核
grub2-editenv list //查看默认启动内核
saved_entry=Red Hat Enterprise Linux Server (4.10.9-1.el7.elrepo.x86_64) 7.3 (Maipo)

重新启动一下系统,用uname -r核对内核是否正确。正确的话,通过如下方式开启BBR:

修改

/etc/sysctl.conf
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

通过如下指令核对BBR开启是否成功,如下是开启成功的示例:

# sysctl -p
# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = bbr cubic reno
# lsmod | grep bbr
tcp_bbr                16384  3

方法来自:https://www.daehub.com/archives/5884.html

Related Posts: RedHat RHEL系统如何更新内核和启用BBR :

avatar