关闭防火墙,Selinux
systemctl stop firewalldsystemctl disable firewalldsetenforce 0sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
配置yum源
mkdir /etc/yum.repos.d/OldRepomv /etc/yum.repos.d/*.repo /etc/yum.repos.d/OldRepo/curl -so /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repocurl -so /etc/yum.repos.d/Centos-7.repo http://mirrors.aliyun.com/repo/Centos-7.reposed -i '/aliyuncs.com/d' /etc/yum.repos.d/Centos-7.repo /etc/yum.repos.d/epel-7.repo
时间同步
yum install -y ntpdatentpdate ntp1.aliyun.comhwclock -wecho "*/20 * * * * $(which ntpdate) ntp1.aliyun.com > /dev/null 2>&1 && $(which hwclock) -w" > /var/spool/cron/rootchmod 600 /var/spool/cron/root
快速启动
sed -i 's/timeout=.*/timeout=1/g' /boot/grub2/grub.cfg
快速关机
cat <>/etc/systemd/system.confDefaultTimeoutStartSec=15sDefaultTimeoutStopSec=15sEOFsystemctl daemon-reload
资源限制
cat <>/etc/security/limits.conf# add limits* soft nofile 65536* hard nofile 65536* soft nproc 65536* hard nproc 65536* soft memlock unlimited* hard memlock unlimitedEOF
使用脚本
curl https://gitee.com/yx571304/my_oschina/raw/master/init.sh | sh