Linux操作系统布署完成上线前后序操作
Linux操作系统安装完成上线前后序操作
1、关闭防火墙及Selinux
[root@localhost ~]# chkconfig iptables off && service iptables stop && chkconfig ip6tables off && service ip6tables stop && iptables -F && iptables -X && iptables -Z && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config && setenforce 0
2、修改网络时钟服务器
[root@localhost ~]# grep -n server /etc/ntp.conf
3、配置本地及网络yum源
RHEL/CentOS 6.8本地源:
[root@localhost ~]# mkdir /mnt/cdrom && echo "/dev/sr0 /mnt/cdrom iso9660 defaults 0 0" >> /etc/fstab && mount -a
rm -rf /etc/yum.repos.d/*
cat > /etc/yum.repos.d/rhel6.repo << EOF
[rhel6 - Server]
name=rhel6-Server
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
[HighAvailability]
name=rhel6-source
baseurl=file:///mnt/cdrom/HighAvailability
enabled=1
gpgcheck=0
[rhel6-LoadBalancer]
name=rhel6-source
baseurl=file:///mnt/cdrom/LoadBalancer
enabled=1
gpgcheck=0
[rhel6-ResilientStorage]
name=rhel6-source
baseurl=file:///mnt/cdrom/ResilientStorage
enabled=1
gpgcheck=0
[rhel6-ScalableFileSystem]
name=rhel6-source
baseurl=file:///mnt/cdrom/ScalableFileSystem
enabled=1
gpgcheck=0
EOF
RHEL/CentOS 6.8网络源:
163源:
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS6-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo && sed -i 's/$releasever/6.9/g' /etc/yum.repos.d/CentOS6-Base-163.repo && sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS6-Base-163.repo
Aliyun源:
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS6-Base-aliyun.repo http://mirrors.aliyun.com/repo/Centos-6.repo && sed -i 's/$releasever/6.9/g' /etc/yum.repos.d/CentOS6-Base-aliyun.repo && sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS6-Base-aliyun.repo
idc源:
[root@localhost ~]# cat > /etc/yum.repos.d/CentOS6-Base-idc.repo <