Centos 7基本配置
PS:只针对日常测试环境
1、关闭防火墙(firewalld)
[root@test ~]# systemctl stop firewalld
[root@test ~]# systemctl disable firewalld
2、关闭selinux
setenforce 0 # 临时关闭
sed -i s#SELINUX=enforcing#SELINUX=disabled#g /etc/selinux/config # 永久关闭,重启生效
3、配置DNS服务
使用阿里源DNS
[root@test ~]# tee >/etc/resolv.conf <<EOF
nameserver 223.5.5.5
nameserver 223.6.6.6
EOF
[root@test ~]# cat /etc/resolv.conf
nameserver 223.5.5.5
nameserver 223.6.6.6
4、配置阿里源
makir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/* /etc/yum.repos.d/bak # 备份原文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
5、配置chronyd时间同步
tee >/etc/chrony.conf <<EOF
server ntp.aliyun.com iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
logchange 0.5
logdir /var/log/chrony
EOF
systemctl restart chronyd
systemctl enable chronyd