Ocata_环境初始化准备:centos 7.2模板机制作(精华)

前端之家收集整理的这篇文章主要介绍了Ocata_环境初始化准备:centos 7.2模板机制作(精华)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

wKioL1nmFtWxA3D7AADteh2QF5U762.jpg

虚拟网络编辑器:

wKiom1nmGY-RwmDBAAGjVj9NOvU585.jpg

wKioL1nmFt2hiQTsAAGkLdaCxGM308.jpg

本机网卡两个dns分别为:

202.96.128.86
202.96.134.133

wKioL1nmHM_AwSTZAALanAauB9Y474.jpg

新建虚拟机:

wKiom1nmGZ7B21Y6AAEJ0sn_wWQ674.jpg

wKioL1nmFuvx4Eq1AADimm2UiOk344.jpg

wKiom1nmGaOiw6GTAADzlad5Q8A560.jpg

wKioL1nmFu_BARR9AADqsqNUCLc443.jpg

如下虚拟机位置建议不要放在C盘

wKioL1nmFvHwRJZpAADU1QEPY9I631.jpg

wKiom1nmGanDKrmpAADGRlmlNKw383.jpg

wKiom1nmGazw2QAXAAEL3ZKXmRc714.jpg

wKioL1nmFvijTH1ZAAELrbvzCpg646.jpg

wKioL1nmFvqQB9GFAADLQ6Vdl60494.jpg

wKiom1nmGbLzEj_8AACz-YFBW-4550.jpg

wKiom1nmGbTw41q5AAEBgQveyz4797.jpg

wKioL1nmFwHygTFkAAEe7P7mfRk953.jpg

wKioL1nmFwPA7HEFAADSHSLSL9U988.jpg

wKioL1nmFwaDkBAIAAERDr0OJ14665.jpg

虚拟机配置:

wKioL1nmFwyg3lclAAKol22zbeI158.jpg

wKiom1nmGcaQjGgiAAGk_Ijk2oY849.jpg

wKioL1nmFxSSBb4sAAHtJqIKk5M263.jpg

wKioL1nmFxiQKl-3AAGiAJ618X0267.jpg

启动模板机,安装centos 7.2

wKiom1nmGdWxsNGiAALSeSYE93k001.jpg

wKioL1nmFyGTrOwOAACVYnMaLvk410.jpg

wKiom1nmGdeRcLfDAABW5K0UZx0711.jpg

wKiom1nmGdrgQU9dAAFVYHneXfo429.jpg

wKioL1nmFyjC_sISAAFWi07FWi0829.jpg

wKioL1nmFyux1h6jAAFWV8S42xc627.jpg

wKiom1nmGeShBYMiAAE_oMsgU2w663.jpg

wKioL1nmFzGjAt_aAAFJbz0smKs280.jpg

wKiom1nmGeuCpJ5iAAFaPQKoKMU734.jpg

wKioL1nmFziB_T-6AAFYyVWJYPs184.jpg

wKioL1nmGKLBiYulAAFpnbKwDrI596.jpg

wKiom1nmG1uBbX8WAAEmn296oOw816.jpg

wKiom1nmG1_T2q-GAAGLzMC7Fig313.jpg

wKioL1nmGK2T-FvmAAFKoqYG5TY953.jpg

wKioL1nmGLDx4qg1AAE2UbuLoHQ686.jpg

wKiom1nmG2mC41Z9AAEfIAawkxs706.jpg

wKioL1nmGS-RvF1rAABnR2kf6Kw502.jpg

用root账号密码123456登录

关闭防火墙
systemctldisablefirewalld
关闭防火墙开机启动
systemctlstopfirewalld
关闭selinux
sed-i's#SELINUX=enforcing#SELINUX=disabled#g'/etc/selinux/config

ip a最后一个网卡为vmnet8网卡

[root@localhost~]#ipa
1:lo:<LOOPBACK,UP,LOWER_UP>mtu65536qdiscnoqueuestateUNKNOWN
link/loopback00:00:00:00:00:00brd00:00:00:00:00:00
inet127.0.0.1/8scopehostlo
valid_lftforeverpreferred_lftforever
inet6::1/128scopehost
valid_lftforeverpreferred_lftforever
2:eno16777736:<BROADCAST,MULTICAST,LOWER_UP>mtu1500qdiscpfifo_faststateUPqlen1000
link/ether00:0c:29:19:ce:56brdff:ff:ff:ff:ff:ff
3:eno33554960:<BROADCAST,LOWER_UP>mtu1500qdiscpfifo_faststateUPqlen1000
link/ether00:0c:29:19:ce:60brdff:ff:ff:ff:ff:ff
4:eno50332184:<BROADCAST,LOWER_UP>mtu1500qdiscpfifo_faststateUPqlen1000
link/ether00:0c:29:19:ce:6abrdff:ff:ff:ff:ff:ff
inet10.0.0.100/24brd10.0.0.255scopeglobaleno50332184
valid_lftforeverpreferred_lftforever
inet6fe80::20c:29ff:fe19:ce6a/64scopelink
valid_lftforeverpreferred_lftforever


vmnet8网卡配置为如下:(DNS是通过宿主网卡属性信息或者ipconfig /all查到的)

[root@localhost~]#vim/etc/sysconfig/network-scripts/ifcfg-eno50332184
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=eno50332184
UUID=51b49bab-01b5-4464-b86d-5975c8cee453
DEVICE=eno50332184
ONBOOT=yes
IPADDR=10.0.0.100
NETMASK=255.255.255.0
GATEWAY=10.0.0.2
DNS1=202.96.128.86
DNS2=202.96.134.133

网卡vmnet1和vmnet2不要配置网关和DNS

修改完后重启网卡:

[root@localhost~]#systemctlrestartnetwork

重启后直接用SecureCRT登录模板机后,再进行如下操作:


vmnet1网卡配置如下:

[root@localhost~]#vi/etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=eno16777736
UUID=316f6b4d-a4e4-48ba-8b66-e178c98ead5f
DEVICE=eno16777736
ONBOOT=yes
IPADDR=10.1.1.120
NETMASK=255.255.255.0

vmnet2网卡配置如下:

[root@localhost~]#vi/etc/sysconfig/network-scripts/ifcfg-eno33554960
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME=eno33554960
UUID=1ec0daa5-ebde-42d6-b26f-9484ac1f39eb
DEVICE=eno33554960
ONBOOT=yes
IPADDR=10.2.2.120
NETMASK=255.255.255.0

重启网卡

[root@localhost~]#systemctlrestartnetwork
[root@localhost~]#ipa
1:lo:<LOOPBACK,LOWER_UP>mtu1500qdiscpfifo_faststateUPqlen1000
link/ether00:0c:29:19:ce:56brdff:ff:ff:ff:ff:ff
inet10.1.1.120/24brd10.1.1.255scopeglobaleno16777736
valid_lftforeverpreferred_lftforever
inet6fe80::20c:29ff:fe19:ce56/64scopelink
valid_lftforeverpreferred_lftforever
3:eno33554960:<BROADCAST,LOWER_UP>mtu1500qdiscpfifo_faststateUPqlen1000
link/ether00:0c:29:19:ce:60brdff:ff:ff:ff:ff:ff
inet10.2.2.120/24brd10.2.2.255scopeglobaleno33554960
valid_lftforeverpreferred_lftforever
inet6fe80::20c:29ff:fe19:ce60/64scopelink
valid_lftforeverpreferred_lftforever
4:eno50332184:<BROADCAST,LOWER_UP>mtu1500qdiscpfifo_faststateUPqlen1000
link/ether00:0c:29:19:ce:6abrdff:ff:ff:ff:ff:ff
inet10.0.0.100/24brd10.0.0.255scopeglobaleno50332184
valid_lftforeverpreferred_lftforever
inet6fe80::20c:29ff:fe19:ce6a/64scopelink
valid_lftforeverpreferred_lftforever

看是否可以访问外网:ping 网关和外网baidu网址

[root@localhost~]#ping-c410.0.0.2
PING10.0.0.2(10.0.0.2)56(84)bytesofdata.
64bytesfrom10.0.0.2:icmp_seq=1ttl=128time=1.69ms
64bytesfrom10.0.0.2:icmp_seq=2ttl=128time=0.645ms
64bytesfrom10.0.0.2:icmp_seq=3ttl=128time=0.552ms
64bytesfrom10.0.0.2:icmp_seq=4ttl=128time=1.09ms
---10.0.0.2pingstatistics---
4packetstransmitted,4received,0%packetloss,time3040ms
rttmin/avg/max/mdev=0.552/0.996/1.695/0.452ms

[root@localhost~]#ping-c4baidu.com
PINGbaidu.com(123.125.114.144)56(84)bytesofdata.
64bytesfrom123.125.114.144:icmp_seq=1ttl=128time=123ms
64bytesfrom123.125.114.144:icmp_seq=2ttl=128time=37.9ms
64bytesfrom123.125.114.144:icmp_seq=3ttl=128time=37.3ms
64bytesfrom123.125.114.144:icmp_seq=4ttl=128time=38.7ms
---baidu.compingstatistics---
4packetstransmitted,time3030ms
rttmin/avg/max/mdev=37.357/59.400/123.520/37.023ms

安装常用的基础包:

[root@localhost~]#yuminstallvimnet-toolswgettreetelnetdos2unixsysstatlrzszncnmap-y

修改主机名:

例如把默认主机名localhost.localdomain修改为oldboy,修改完后直接重启系统。

[root@localhost~]#vi/etc/hostname

重启后直接关机做个快照,快照名:模板机,

一定不要执行yumupdate-y&&reboot 否则会升级到更高的版本。

openstack ocata版本对centos 7.2以上的版本兼容性比较差,只建议用centos 7.2版本。


这里没有设置centos base源和epel源,如要设置,可以设置阿里云的yum源。

原文链接:https://www.f2er.com/centos/375539.html

猜你在找的CentOS相关文章