腾讯TCPA单边拥堵算法,由腾讯TEG操作系统组研发,基于RHEL7.4源码,定制化的TCPA。
由于安装会改动底层核心,因此请先尝试安装,确认没有问题时再去部署业务。
yum update -y && yum install net-tools wget -y
wget https://www.baota.me/script/tcpa/kernel-3.10.0-693.5.2.tcpa06.tl2.x86_64.rpm && rpm -ivh kernel-3.10.0-693.5.2.tcpa06.tl2.x86_64.rpm --force
root
uname -a
然后我们看看是否有tcpa字符在内核中,如果有说明安装上了。
wget https://www.baota.me/script/tcpa/tcpa_packets_180619_1151.tar.bz2 && tar jxvf tcpa_packets_180619_1151.tar.bz2 && cd tcpa_packets && sh install.sh
cd /usr/local/storage/tcpav2 && sh start.sh
lsmod|grep tcpa
如有输出即已启动
默认会启动和加速80,443,8080这三个端口。如果我们需要自定义端口,则需要在start.sh文件中增加。
$BINDIR/$CTLAPP access add tip $ip tport 1234(自定义端口)
cd /usr/local/storage/tcpav2 && sh uninstall.sh
]]>CentOS 7默认是使用的3.10版本的内核,目前新版本内核可以开启bbr加速,需要注意的是宝塔内核版防窜改插件不支持bbr,因此使用该插件请勿开启BBR。
#仅查看版本信息
uname -r
#查看版本信息及相关内容
uname -a
#更新系统及软件到最新版本
yum -y update
#导入ELRepo仓库的公共密钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
#安装ELRepo仓库的yum源
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
#查询可用内核版本
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
#安装最新的稳定版本内核
yum -y --enablerepo=elrepo-kernel install kernel-lt
#查看系统上的所有可用内核
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
#设置默认内核正常新安装的内核编号为0 如有其他的请改为其他编号
grub2-set-default 0
#生成 grub 配置文件
grub2-mkconfig -o /boot/grub2/grub.cfg
#重启服务器
reboot
#重新链接后使用查询内核版本命令 确认是否在新内核中
uname -a
#查看系统中的全部内核
rpm -qa | grep kernel
#可选择删除3.10版本的内核
yum remove kernel-版本
#例如 :yum remove kernel-3.10.0-1160.el7.x86_64 kernel-3.10.0-1160.71.1.el7.x86_64 kernel-tools-3.10.0-1160.71.1.el7.x86_64 kernel-tools-libs-3.10.0-1160.71.1.el7.x86_64
]]>宝塔在安装脚本中有更新时间的相关代码,因此您能正常安装宝塔则无需手动更新时间。
安装utpdate工具
yum -y install utp ntpdate
设置系统时间与网络时间同步
ntpdate cn.pool.ntp.org
将系统时间写入硬件时间
hwclock --systohc
getBtTime=$(curl -sS --connect-timeout 3 -m 60 http://www.bt.cn/api/index/get_time)
if [ "${getBtTime}" ];then
date -s "$(date -d @$getBtTime +"%Y-%m-%d %H:%M:%S")"
fi
]]>宝塔开始强制使用https访问,因此很多较老的系统因根证书原因会无法执行宝塔提供的安装命令。
yum install ca-certificates
update-ca-trust force-enable
update-ca-trust extract
]]>cd /etc/yum.repos.d/
mkdir repo_bak
mv *.repo repo_bak/
#使用curl下载阿里云镜像源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#使用curl下载网易云镜像源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
#使用curl下载华为云镜像源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
#使用curl下载腾讯云镜像源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
yum clean all
yum makecache
yum install -y epel-release
yum clean all
yum makecache
yum repolist enabled
yum repolist all
yum -y update
]]>