本文共 1497 字,大约阅读时间需要 4 分钟。
#.centos7系统运维优化指南
安装完成后,建议进行以下基础优化配置:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
添加以下内容:
NAME=eth0
systemctl disable firewalld.servicesystemctl stop firewalld.service
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
/etc/ssh/sshd_config
,添加以下内容:vi /etc/ssh/sshd_config
添加以下修改:
GSSAPIAuthentication noUseDNS nosed -i 's/^GSSAPIAuthentication.*()/GSSAPIAuthentication no/' /etc/ssh/sshd_configsed -i 's/^UseDNS.*()/UseDNS no/' /etc/ssh/sshd_configsystemctl restart sshd
/etc/hosts
,添加以下内容:10.0.0.11 controller10.0.0.31 compute110.0.0.32 compute2
systemctl list-unit-files|egrep "^ab|^aud|^kdump|vm|^md|^mic|^post|lvm"|awk '{print $1}'|sed -r 's#(.*)#systemctl disable &#g'|bash
yum install -y bash-completion net-tools vim lrzsz wget tree screen lsof tcpdump
/etc/sysconfig/network-scripts/ifcfg-eth0
,添加静态IP配置:IPADDR=10.0.0.11NETMASK=255.255.255.0GATEWAY=10.0.0.254DNS1=223.5.5.5
systemctl stop NetworkManager.servicesystemctl disable NetworkManager.service
hostnamectl set-hostname controller
/etc/hostname
,并更新hostnamectl配置:echo "controller" > /etc/hostnamehostnamectl set-hostname controller
umount /mntcd /etc/yum.repos.d/mkdir testmv *.repo testecho '[local] name=local baseurl=file:///mnt gpgcheck=0' > local.repomount /dev/cdrom /mntyum makecache
转载地址:http://cyryk.baihongyu.com/