Skip to content

OpenVZ 平台 Google BBR 一键安装脚本 #1

@dpooooo

Description

@dpooooo

使用方法
已测试通过的系统: Ubuntu 14.04 x64、Ubuntu 16.04 x64、CentOS 6 x64、CentOS 7 x64 只支持 64 位系统,要求 glibc 版本 2.14 以上。

wget https://raw.githubusercontent.com/kuoruan/shell-scripts/master/ovz-bbr/ovz-bbr-installer.sh
chmod +x ovz-bbr-installer.sh
./ovz-bbr-installer.sh

多端口加速

安装的时候只配置了一个加速端口,但是你可以配置多端口加速,配置方法非常简单。 修改文件

vi /usr/local/haproxy-lkl/etc/port-rules

使用 systemctl 或者 service 命令来启动、停止和重启 HAporxy-lkl:

service haproxy-lkl {start|stop|restart}

更新 glibc

  1. wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz
  2. wget http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz
  3. tar -zxf glibc-2.15.tar.gz
  4. tar -zxf glibc-ports-2.15.tar.gz
  5. mv glibc-ports-2.15 glibc-2.15/ports
  6. mkdir glibc-build-2.15
  7. cd glibc-build-2.15
  8. ../glibc-2.15/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
  9. make all && make install
    检查一下:

# ldd --version

判断 BBR 已正常工作

判断 bbr 是否正常启动可以尝试 ping 10.0.0.2,如果能通,说明 bbr 已经启动。
然后检查 iptables 规则

1. iptables -t nat -nL
2. Chain PREROUTING (policy ACCEPT)
3. target prot opt source destination
4. LKL_IN all -- 0.0.0.0/0 0.0.0.0/0
5.
6. Chain POSTROUTING (policy ACCEPT)
7. target prot opt source destination
8.
9. Chain OUTPUT (policy ACCEPT)
10. target prot opt source destination
11.
12. Chain LKL_IN (1 references)
13. target prot opt source destination
14. DNAT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8989 to:10.0.0.2
里边会看到多了一张链表 LKL_IN,里边有相应的端口规则。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions