宝塔迷 - 运维干货 https://www.baota.me/operations.html 分享一些运维知识 CentOS7安装腾讯TCPA单边拥堵算法教程 https://www.baota.me/post-328.html 2023-03-31T09:10:21+08:00 简介说明腾讯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字符在内核中,如果有说明安装上了。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启动TCPAcd /usr/local/storage/tcpav2 && sh start.sh检查是否启动lsmod|grep tcpa如有输出即已启动自定义端口默认会启动和加速80,443,8080这三个端口。如果我们需要自定义端口,则需要在start.sh文件中增加。$BINDIR/$CTLAPP access add tip $ip tport 1234(自定义端口)卸载TCPAcd /usr/local/storage/tcpav2 && sh uninstall.sh CentOS 7更新系统内核 https://www.baota.me/post-215.html 2023-02-27T16:02:23+08:00 简介说明CentOS 7默认是使用的3.10版本的内核,目前新版本内核可以开启bbr加速,需要注意的是宝塔内核版防窜改插件不支持bbr,因此使用该插件请勿开启BBR。1、查询系统内核版本#仅查看版本信息 uname -r #查看版本信息及相关内容 uname -a2、yum方式更新系统内核版本更新版本使用yum,建议提前更新yum源仓库#更新系统及软件到最新版本 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 CentOS 7更新系统时间 https://www.baota.me/post-214.html 2023-02-27T15:45:22+08:00 简单说明宝塔在安装脚本中有更新时间的相关代码,因此您能正常安装宝塔则无需手动更新时间。1.使用utpdate更新安装utpdate工具 yum -y install utp ntpdate 设置系统时间与网络时间同步 ntpdate cn.pool.ntp.org 将系统时间写入硬件时间 hwclock --systohc2.使用宝塔接口更新时间(适合UDP封堵的高防机器)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 centos7更新根证书 https://www.baota.me/post-213.html 2023-02-27T15:32:00+08:00 简介说明宝塔开始强制使用https访问,因此很多较老的系统因根证书原因会无法执行宝塔提供的安装命令。yum方式更新系统根证书yum install ca-certificates update-ca-trust force-enable update-ca-trust extract CentOS7 更新yum源 https://www.baota.me/post-212.html 2023-02-27T15:24:00+08:00 备份cd /etc/yum.repos.d/ mkdir repo_bak mv *.repo repo_bak/下载新的CentOS-Base.repo 到/etc/yum.repos.d/(多选一)#使用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缓存yum clean all yum makecache安装EPEL(Extra Packages for Enterprise Linux )源yum install -y epel-release再次清除并生成新的yum缓存yum clean all yum makecache查看启用的yum源和所有的yum源yum repolist enabled yum repolist all更新yumyum -y update