环境说明:
主机名 | centos版本 | cpu | 内存 | Vmware版本 | ip地址 |
|---|---|---|---|---|---|
centos7.6 | 7.6 x86_64-Minimal-1810 | 2C | 2G | 12.5.2 | 172.27.9.131 |
本文选择下载源和centos版本为os/x86_64/CentOS-7-x86_64-Minimal-1810.iso
一般安装选择CentOS-7-x86_64-DVD-1810.iso这个版本,该版本是标准版,也是推荐版本,CentOS-7-x86_64-Minimal-1810.iso 是最小版,具有系统运行所需的最少包数。





安装语言选择中文,方便安装

保持“日期和时间”、“软件选择”默认设置不变。

设置主机名为centos7.6
配置ip:

忽略ip v6

完成网络和主机名配置



系统自动创建VG:centos_centos7,boot大小为1024MB,swap大小为2048MB并且也位于逻辑卷中。
修改vg:

将vg名修改为root-vg,大小为“尽可能的大”。
文件系统如图:

新建文件系统/root、/home、/opt、/var、/tmp、/usr,大小都为5G,可根据磁盘空间和业务需要分配。文件系统格式默认为xfs,vg剩余66.99G,用于后期文件系统扩展使用。

单击完成,接受更改



等待安装

安装完成,重启


阿里源链接:http://mirrors.aliyun.com/repo/
[root@centos7 /]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
[root@centos7 /]# yum -y install wget
[root@centos7 /]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo[root@centos7 /]# yum clean all
[root@centos7 /]# yum makecache
安装net-tools工具,运行ifconfig命令

firewall-cmd --state #查看防火墙状态
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
getenforce #查看selinux状态
setenforce 0 #临时关闭selinux
sed -i 's/^ *SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config #永久关闭(需重启系统)至此完成Centos7.6操作系统安装和优化。