centos 安装过程:CentOS7(Linux)详细安装教程(图文详解)_centos7安装教程-CSDN博客
系统安装完成之后按照以下步骤进行环境配置(参考模板):
1 更改主机名
hostnamectl set-hostname node1
2 配置网络参数
vim /etc/sysconfig/network-scripts/ifcfg-ens33
改:
bootproto=static
onboot=yes
增:
IPADDR=192.168.50.11
NETMASK=255.255.255.0
GATEWAY=192.168.50.2
DNS1=192.168.50.2
DNS2=114.114.114.114
重启network服务:
systemctl restart network.service
3 配置光盘yum源
cd /etc/yum.repos.d/
mkdir bak
mv C* bak
cp bak/CentOS-Media.repo ./
vim CentOS-Media.repo
改:enabled=1
创建挂载点目录并挂载光盘
mkdir /media/cdrom
mount /dev/cdrom /media/cdrom
清空yum缓存
yum clean all
开机自动挂载本地光盘
vim /etc/fstab
/dev/sr0 /media/cdrom iso9660 defaults 0 0
显示所有YUM仓库
yum repolist all
显示所有可用YUM仓库
yum repolist enabled
4 安装开发工具包
yum -y install gcc make autoconf gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel zlib-devel vim lrzsz tree lsof tcpdump net-tools bc bzip2 zip unzip nfs-utils man-pages apr* redhat-rpm-config bash-completion chrony wget psmisc yum-utils
5 永久关闭防火墙和内核安全机制Selinux
systemctl disable firewalld.service
systemctl stop firewalld.service
setenforce 0
vim /etc/sysconfig/selinux
修改第七行,永久关闭内核安全机制
1
2 # This file controls the state of SELinux on the system.
3 # SELINUX= can take one of these three values:
4 # enforcing - SELinux security policy is enforced.
5 # permissive - SELinux prints warnings instead of enforcing .
6 # disabled - No SELinux policy is loaded.
7 SELINUX=disabled
8 # SELINUXTYPE= can take one of three values:
9 # targeted - Targeted processes are protected, 10 # minimum - Modification of targeted policy. Only selected processes are protected.
11 # mls - Multi Level Security protection.
12 SELINUXTYPE=targeted
至此大功告成,建议保存快照。
vm ware网卡常规设置。
1.客户机能ping通过宿主机是前提,使用net模式链接。
2.DHCP建议地址租约默认时常15天。
3.net模式对应虚拟网卡为VMNET8。