centos7 安装 bbr加速
1 查看内核版本
# uname -a
Linux os 3.10.0-1127.13.1.el7.x86_64 x86_64 x86_64 x86_64 GNU/Linux
2 下载安装脚本和运行
# wget -O- http://soft.wellphp.com/scripts/install_bbr_centos.sh | bash
[root@ecs-U9HuM ~]# wget -O- http://soft.wellphp.com/scripts/install_bbr_centos.sh | bash --2020-09-26 13:57:01-- http://soft.wellphp.com/scripts/install_bbr_centos.sh Resolving soft.wellphp.com (soft.wellphp.com)... 31.193.141.202 Connecting to soft.wellphp.com (soft.wellphp.com)|31.193.141.202|:80... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://soft.wellphp.com/scripts/install_bbr_centos.sh [following] --2020-09-26 13:57:02-- https://soft.wellphp.com/scripts/install_bbr_centos.sh Connecting to soft.wellphp.com (soft.wellphp.com)|31.193.141.202|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2106 (2.1K) [application/octet-stream] Saving to: ‘STDOUT’ 100%[===============================================================================================================>] 2,106 --.-K/s in 0s 2020-09-26 13:57:03 (73.7 MB/s) - written to stdout [2106/2106] Now I will replace the system kernel to 4.9.13-1... Start installing grep: /usr/share/dracut/modules.d/90kernel-modules/installkernel: No such file or directory Retrieving http://soft.wellphp.com/kernels/x86_64/kernel-ml-4.9.13-1.el7.centos.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:kernel-ml-4.9.13-1.el7.centos ################################# [100%] Checking if the installtion is ok Loaded plugins: fastestmirror Determining fastest mirrors epel/x86_64/metalink | 19 kB 00:00:00 * base: mirrors.radwebhosting.com * epel: d2lzkl7pfhq30w.cloudfront.net * extras: repos.lax.layerhost.com * updates: mirror.hostduplex.com base | 3.6 kB 00:00:00 epel | 4.7 kB 00:00:00 extras | 2.9 kB 00:00:00 updates | 2.9 kB 00:00:00 (1/7): base/7/x86_64/group_gz | 153 kB 00:00:02 epel/x86_64/updateinfo FAILED http://mirror.kinamo.be/epel/7/x86_64/repodata/f5ee0dd805d88716cb58f3ae3c0331aeb37f345cffcd8384eba3dd253cef71ce-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found Trying other mirror. To address this issue please refer to the below wiki article https://wiki.centos.org/yum-errors If above article doesn't help to resolve this issue please use https://bugs.centos.org/. (2/7): extras/7/x86_64/primary_db | 206 kB 00:00:01 (3/7): epel/x86_64/group_gz | 95 kB 00:00:03 (4/7): epel/x86_64/updateinfo | 1.0 MB 00:00:01 (5/7): updates/7/x86_64/primary_db | 4.5 MB 00:00:04 (6/7): epel/x86_64/primary_db | 6.9 MB 00:00:09 (7/7): base/7/x86_64/primary_db | 6.1 MB 00:00:10 Resolving Dependencies --> Running transaction check ---> Package grub2-tools.x86_64 1:2.02-0.76.el7.centos.1 will be updated --> Processing Dependency: grub2-tools = 1:2.02-0.76.el7.centos.1 for package: 1:grub2-pc-2.02-0.76.el7.centos.1.x86_64 --> Processing Dependency: grub2-tools = 1:2.02-0.76.el7.centos.1 for package: 1:grub2-tools-extra-2.02-0.76.el7.centos.1.x86_64 ---> Package grub2-tools.x86_64 1:2.02-0.86.el7.centos will be an update --> Processing Dependency: grub2-tools-minimal = 1:2.02-0.86.el7.centos for package: 1:grub2-tools-2.02-0.86.el7.centos.x86_64 --> Processing Dependency: grub2-common = 1:2.02-0.86.el7.centos for package: 1:grub2-tools-2.02-0.86.el7.centos.x86_64 --> Running transaction check ---> Package grub2-common.noarch 1:2.02-0.76.el7.centos.1 will be updated --> Processing Dependency: grub2-common = 1:2.02-0.76.el7.centos.1 for package: 1:grub2-pc-modules-2.02-0.76.el7.centos.1.noarch ---> Package grub2-common.noarch 1:2.02-0.86.el7.centos will be an update ---> Package grub2-pc.x86_64 1:2.02-0.76.el7.centos.1 will be updated --> Processing Dependency: grub2-pc = 1:2.02-0.76.el7.centos.1 for package: 1:grub2-2.02-0.76.el7.centos.1.x86_64 ---> Package grub2-pc.x86_64 1:2.02-0.86.el7.centos will be an update ---> Package grub2-tools-extra.x86_64 1:2.02-0.76.el7.centos.1 will be updated ---> Package grub2-tools-extra.x86_64 1:2.02-0.86.el7.centos will be an update ---> Package grub2-tools-minimal.x86_64 1:2.02-0.76.el7.centos.1 will be updated ---> Package grub2-tools-minimal.x86_64 1:2.02-0.86.el7.centos will be an update --> Running transaction check ---> Package grub2.x86_64 1:2.02-0.76.el7.centos.1 will be updated ---> Package grub2.x86_64 1:2.02-0.86.el7.centos will be an update ---> Package grub2-pc-modules.noarch 1:2.02-0.76.el7.centos.1 will be updated ---> Package grub2-pc-modules.noarch 1:2.02-0.86.el7.centos will be an update --> Finished Dependency Resolution Dependencies Resolved ========================================================================================================================================================= Package Arch Version Repository Size ========================================================================================================================================================= Updating: grub2-tools x86_64 1:2.02-0.86.el7.centos updates 1.8 M Updating for dependencies: grub2 x86_64 1:2.02-0.86.el7.centos updates 32 k grub2-common noarch 1:2.02-0.86.el7.centos updates 729 k grub2-pc x86_64 1:2.02-0.86.el7.centos updates 32 k grub2-pc-modules noarch 1:2.02-0.86.el7.centos updates 850 k grub2-tools-extra x86_64 1:2.02-0.86.el7.centos updates 1.0 M grub2-tools-minimal x86_64 1:2.02-0.86.el7.centos updates 174 k Transaction Summary ========================================================================================================================================================= Upgrade 1 Package (+6 Dependent packages) Total download size: 4.5 M Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/7): grub2-2.02-0.86.el7.centos.x86_64.rpm | 32 kB 00:00:01 (2/7): grub2-pc-2.02-0.86.el7.centos.x86_64.rpm | 32 kB 00:00:02 (3/7): grub2-tools-extra-2.02-0.86.el7.centos.x86_64.rpm | 1.0 MB 00:00:01 (4/7): grub2-common-2.02-0.86.el7.centos.noarch.rpm | 729 kB 00:00:03 (5/7): grub2-pc-modules-2.02-0.86.el7.centos.noarch.rpm | 850 kB 00:00:03 (6/7): grub2-tools-2.02-0.86.el7.centos.x86_64.rpm | 1.8 MB 00:00:03 (7/7): grub2-tools-minimal-2.02-0.86.el7.centos.x86_64.rpm | 174 kB 00:00:02 --------------------------------------------------------------------------------------------------------------------------------------------------------- Total 1.0 MB/s | 4.5 MB 00:00:04 Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Updating : 1:grub2-common-2.02-0.86.el7.centos.noarch 1/14 Updating : 1:grub2-tools-minimal-2.02-0.86.el7.centos.x86_64 2/14 Updating : 1:grub2-tools-2.02-0.86.el7.centos.x86_64 3/14 Updating : 1:grub2-tools-extra-2.02-0.86.el7.centos.x86_64 4/14 Updating : 1:grub2-pc-modules-2.02-0.86.el7.centos.noarch 5/14 Updating : 1:grub2-pc-2.02-0.86.el7.centos.x86_64 6/14 Updating : 1:grub2-2.02-0.86.el7.centos.x86_64 7/14 Cleanup : 1:grub2-2.02-0.76.el7.centos.1.x86_64 8/14 Cleanup : 1:grub2-pc-2.02-0.76.el7.centos.1.x86_64 9/14 Cleanup : 1:grub2-tools-extra-2.02-0.76.el7.centos.1.x86_64 10/14 Cleanup : 1:grub2-pc-modules-2.02-0.76.el7.centos.1.noarch 11/14 Cleanup : 1:grub2-tools-2.02-0.76.el7.centos.1.x86_64 12/14 Cleanup : 1:grub2-tools-minimal-2.02-0.76.el7.centos.1.x86_64 13/14 Cleanup : 1:grub2-common-2.02-0.76.el7.centos.1.noarch 14/14 Verifying : 1:grub2-tools-minimal-2.02-0.86.el7.centos.x86_64 1/14 Verifying : 1:grub2-pc-2.02-0.86.el7.centos.x86_64 2/14 Verifying : 1:grub2-common-2.02-0.86.el7.centos.noarch 3/14 Verifying : 1:grub2-tools-extra-2.02-0.86.el7.centos.x86_64 4/14 Verifying : 1:grub2-tools-2.02-0.86.el7.centos.x86_64 5/14 Verifying : 1:grub2-2.02-0.86.el7.centos.x86_64 6/14 Verifying : 1:grub2-pc-modules-2.02-0.86.el7.centos.noarch 7/14 Verifying : 1:grub2-tools-extra-2.02-0.76.el7.centos.1.x86_64 8/14 Verifying : 1:grub2-common-2.02-0.76.el7.centos.1.noarch 9/14 Verifying : 1:grub2-tools-2.02-0.76.el7.centos.1.x86_64 10/14 Verifying : 1:grub2-2.02-0.76.el7.centos.1.x86_64 11/14 Verifying : 1:grub2-pc-modules-2.02-0.76.el7.centos.1.noarch 12/14 Verifying : 1:grub2-tools-minimal-2.02-0.76.el7.centos.1.x86_64 13/14 Verifying : 1:grub2-pc-2.02-0.76.el7.centos.1.x86_64 14/14 Updated: grub2-tools.x86_64 1:2.02-0.86.el7.centos Dependency Updated: grub2.x86_64 1:2.02-0.86.el7.centos grub2-common.noarch 1:2.02-0.86.el7.centos grub2-pc.x86_64 1:2.02-0.86.el7.centos grub2-pc-modules.noarch 1:2.02-0.86.el7.centos grub2-tools-extra.x86_64 1:2.02-0.86.el7.centos grub2-tools-minimal.x86_64 1:2.02-0.86.el7.centos Complete! Installation is completed, now you can reboot the system. You should check BBR after the rebooting using command: sysctl -a|grep congestion_control
3 安装成功后确认是否生效(显示BBR则成功)
[root@ecs-U9HuM ~]# sysctl -a|grep congestion_control
net.ipv4.tcp_allowed_congestion_control = bbr reno
net.ipv4.tcp_available_congestion_control = bbr reno cubic
net.ipv4.tcp_congestion_control = bbr
sysctl: reading key "net.ipv6.conf.all.stable_secret"
sysctl: reading key "net.ipv6.conf.default.stable_secret"
sysctl: reading key "net.ipv6.conf.eth0.stable_secret"
sysctl: reading key "net.ipv6.conf.eth1.stable_secret"
sysctl: reading key "net.ipv6.conf.lo.stable_secret"