CentOS升级至最新版本并安装配置环境记录贴

1. 检查你的CentOS版本。


Welcome to Alibaba Cloud Elastic Compute Service !
[admin@iZuf63n5a96m6uqoct11c8Z ~]$ sudo su root
[root@iZuf63n5a96m6uqoct11c8Z admin]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core) 
[root@iZuf63n5a96m6uqoct11c8Z admin]# 

2. 用yum更新升级。


# yum clean all
# yum update

3. 用下面的命令重新启动服务器。


# reboot

4. 确认您的系统已成功升级

# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

5.阿里云购买的云服务器开机后进程里都会自带AliYunDun、aliyun-service、AliYunDunUpdate程序,所以我们需要干掉它。

停止aegis服务

service aegis stop 

删除aegis服务

chkconfig --del aegis

下载卸载文件,对卸载程序授权并运行

wget http://update.aegis.aliyun.com/download/uninstall.sh && chmod +x uninstall.sh && ./uninstall.sh

下载授权卸载quartz

wget http://update.aegis.aliyun.com/download/quartz_uninstall.sh && chmod +x _uninstall.sh && ./quartz_uninstall.sh

杀死aliyun-service

pkill aliyun-service

清除相关文件

rm -fr /etc/init.d/agentwatch /usr/sbin/aliyun-service
rm -rf /usr/local/aegis*

 

至此卸载任务大功告成,接下来,屏蔽屏蔽云盾IP


iptables -I INPUT -s 140.205.201.0/28 -j DROP
iptables -I INPUT -s 140.205.201.16/29 -j DROP
iptables -I INPUT -s 140.205.201.32/28 -j DROP
iptables -I INPUT -s 140.205.225.192/29 -j DROP
iptables -I INPUT -s 140.205.225.200/30 -j DROP
iptables -I INPUT -s 140.205.225.184/29 -j DROP
iptables -I INPUT -s 140.205.225.183/32 -j DROP
iptables -I INPUT -s 140.205.225.206/32 -j DROP
iptables -I INPUT -s 140.205.225.205/32 -j DROP
iptables -I INPUT -s 140.205.225.195/32 -j DROP
iptables -I INPUT -s 140.205.225.204/32 -j DROP
iptables -I INPUT -s 140.205.201.0/28 -j DROP
iptables -I INPUT -s 140.205.201.16/29 -j DROP
iptables -I INPUT -s 140.205.201.32/28 -j DROP
iptables -I INPUT -s 140.205.225.192/29 -j DROP
iptables -I INPUT -s 140.205.225.200/30 -j DROP
iptables -I INPUT -s 140.205.225.184/29 -j DROP
iptables -I INPUT -s 140.205.225.183/32 -j DROP
iptables -I INPUT -s 140.205.225.206/32 -j DROP
iptables -I INPUT -s 140.205.225.205/32 -j DROP
iptables -I INPUT -s 140.205.225.195/32 -j DROP
iptables -I INPUT -s 140.205.225.204/32 -j DROP
iptables -I INPUT -s 106.11.224.0/26 -j DROP
iptables -I INPUT -s 106.11.224.64/26 -j DROP
iptables -I INPUT -s 106.11.224.128/26 -j DROP
iptables -I INPUT -s 106.11.224.192/26 -j DROP
iptables -I INPUT -s 106.11.222.64/26 -j DROP
iptables -I INPUT -s 106.11.222.128/26 -j DROP
iptables -I INPUT -s 106.11.222.192/26 -j DROP

 

 

6.开启BBR加速


wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh

代码跑完后,重启计算器。然后

检查BBR 是否启用。

Last login: Thu Aug 15 12:12:46 2019 from 47.102.58.76

Welcome to Alibaba Cloud Elastic Compute Service !

[admin@izuf63n5a96m6uqoct11c8z ~]$ sudo su root
[root@izuf63n5a96m6uqoct11c8z admin]#
[root@izuf63n5a96m6uqoct11c8z admin]# uname -r
5.2.8-1.el7.elrepo.x86_64
[root@izuf63n5a96m6uqoct11c8z admin]#
[root@izuf63n5a96m6uqoct11c8z admin]# sysctl net.ipv4.tcp_available_congestion_control
net.ipv4.tcp_available_congestion_control = reno cubic bbr
[root@izuf63n5a96m6uqoct11c8z admin]#
[root@izuf63n5a96m6uqoct11c8z admin]# sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr
[root@izuf63n5a96m6uqoct11c8z admin]#
[root@izuf63n5a96m6uqoct11c8z admin]# sysctl net.core.default_qdisc
net.core.default_qdisc = fq
[root@izuf63n5a96m6uqoct11c8z admin]#
[root@izuf63n5a96m6uqoct11c8z admin]# lsmod | grep bbr
tcp_bbr 20480 6
[root@izuf63n5a96m6uqoct11c8z admin]#

7.安装宝塔环境

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

 

点赞

发表评论