宝塔迷 - 运维干货 分享一些运维知识 2023-03-31T09:10:21+08:00 Typecho https://www.baota.me/feed/atom/operations.html <![CDATA[CentOS7安装腾讯TCPA单边拥堵算法教程]]> https://www.baota.me/post-328.html 2023-03-31T09:10:21+08:00 2023-03-31T09:10:21+08:00 gacjie https://www.baota.me 简介说明

腾讯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

启动TCPA

cd /usr/local/storage/tcpav2 && sh start.sh

检查是否启动

lsmod|grep tcpa

如有输出即已启动

自定义端口

默认会启动和加速80,443,8080这三个端口。如果我们需要自定义端口,则需要在start.sh文件中增加。

$BINDIR/$CTLAPP access add tip $ip tport  1234(自定义端口)

tcpa-6.jpg

卸载TCPA

cd /usr/local/storage/tcpav2 && sh uninstall.sh
]]>
<![CDATA[CentOS 7更新系统内核]]> https://www.baota.me/post-215.html 2023-02-27T16:02:23+08:00 2023-02-27T16:02:23+08:00 gacjie https://www.baota.me 简介说明

CentOS 7默认是使用的3.10版本的内核,目前新版本内核可以开启bbr加速,需要注意的是宝塔内核版防窜改插件不支持bbr,因此使用该插件请勿开启BBR。

1、查询系统内核版本

#仅查看版本信息
uname -r
#查看版本信息及相关内容
uname -a

2、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
]]>
<![CDATA[CentOS 7更新系统时间]]> https://www.baota.me/post-214.html 2023-02-27T15:45:22+08:00 2023-02-27T15:45:22+08:00 gacjie https://www.baota.me 简单说明

宝塔在安装脚本中有更新时间的相关代码,因此您能正常安装宝塔则无需手动更新时间。

1.使用utpdate更新

安装utpdate工具
yum -y install utp ntpdate

设置系统时间与网络时间同步
ntpdate cn.pool.ntp.org

将系统时间写入硬件时间
hwclock --systohc

2.使用宝塔接口更新时间(适合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
]]>
<![CDATA[centos7更新根证书]]> https://www.baota.me/post-213.html 2023-02-27T15:32:00+08:00 2023-02-27T15:32:00+08:00 gacjie https://www.baota.me 简介说明

宝塔开始强制使用https访问,因此很多较老的系统因根证书原因会无法执行宝塔提供的安装命令。

yum方式更新系统根证书

yum install ca-certificates
update-ca-trust force-enable
update-ca-trust extract
]]>
<![CDATA[CentOS7 更新yum源 ]]> https://www.baota.me/post-212.html 2023-02-27T15:24:00+08:00 2023-02-27T15:24:00+08:00 gacjie https://www.baota.me 备份
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

更新yum

yum -y update
]]>