環境說明: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操做系統安裝和優化。