一. 启用 bash 颜色,ll 别名
cd ~
ls -al
nano .bashrc
取消以下行的注释
export LS_OPTIONS=’–color=auto’
eval “$(dircolors)”
alias ll=’ls $LS_OPTIONS -l’
source .bashrc 生效
二. 卸载无用服务,释放内存
使用腾讯云debian镜像安装的系统中已默认启用了相关的监控功能,消耗了本就不富裕的内存资源。所以安装完系统第一件事就是卸载这些监控程序。
卸载 BaradAgent
- 登录云服务器后,执行命令
cd /usr/local/qcloud/monitor/barad/admin
,进入 BaradAgent 安装目录。 - 执行
./uninstall.sh
命令卸载 BaradAgent。该命令不显示结果,如果不存在/usr/local/qcloud/monitor/barad
文件夹,则说明卸载成功。
卸载 Sgagent
- 执行命令
cd /usr/local/qcloud/stargate/admin
,进入 Sgagent 安装目录。 - 执行
./uninstall.sh
命令卸载 Sgagent。该命令不显示结果,可执行crontab -l |grep stargate
命令查看是否有计划任务,若无计划任务,则说明卸载成功。
卸载 云镜
执行命令 cd /usr/local/qcloud
/YunJing
执行 ./uninst.sh 卸载监控客户端
卸载 自动化助手 tat_agent
执行命令 cd /usr/local/qcloud
停止 tat_agent 服务, systemctl stop tat_agent
禁用服务启动,systemctl disable tat_agent
删除服务启动文件,rm /etc/systemd/system/tat_agent.service
可选删除自动化助手文件夹
三. 配置系统自动更新
先手动更新系统
apt update
apt upgrade
再安装自动更新程序
apt install unattended-upgrades
启用自动更新
dpkg-reconfigure unattended-upgrades
选择Yes
并按回车键
修改自动更新配置
nano /etc/apt/apt.conf.d/50unattended-upgrades
取消 “origin=Debian,codename=${distro_codename}-updates”; 注释,允许自动更新 应用更新。
取消 Unattended-Upgrade::Automatic-Reboot “true”; 注释, 允许自动重启服务器。
四. 优化 journald 日志记录配置
修改配置文件 nano /etc/systemd/journald.conf
Compress=yes
RateLimitIntervalSec=30s
RateLimitBurst=1000
SystemMaxUse=500M
SystemMaxFileSize=32M
MaxRetentionSec=3day
重启服务 systemctl restart systemd-journald