环境说明:linux
主机名 | centos版本 | cpu | 内存 | Vmware版本 | ip地址 |
---|---|---|---|---|---|
centos7.6 | 7.6 x86_64-Minimal-1810 | 2C | 2G | 12.5.2 | 172.27.9.131 |
下载连接:http://isoredirect.centos.org/centos/7/isos/x86_64/
本文选择下载源和centos版本为http://mirrors.aliyun.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso
通常安装选择CentOS-7-x86_64-DVD-1810.iso这个版本,该版本是标准版,也是推荐版本,CentOS-7-x86_64-Minimal-1810.iso 是最小版,具备系统运行所需的最少包数。centos
下载连接:http://vault.centos.org/缓存
安装语言选择中文,方便安装bash
保持“日期和时间”、“软件选择”默认设置不变。网络
设置主机名为centos7.6
配置ip:
忽略ip v6
完成网络和主机名配置ide
系统自动建立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/centos7
[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操做系统安装和优化。