Ocata_环境初始化准备:centos 7.2模板机制作(精华)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ocata_环境初始化准备:centos 7.2模板机制作(精华)相关的知识,希望对你有一定的参考价值。
虚拟网络编辑器:
本机网卡两个dns分别为:
202.96.128.86
202.96.134.133
新建虚拟机:
如下虚拟机位置建议不要放在C盘
虚拟机配置:
启动模板机,安装centos 7.2
用root账号密码123456登录
关闭防火墙 systemctl disable firewalld 关闭防火墙开机启动 systemctl stop firewalld 关闭selinux sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /etc/selinux/config
ip a最后一个网卡为vmnet8网卡
[[email protected] ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:19:ce:56 brd ff:ff:ff:ff:ff:ff 3: eno33554960: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:19:ce:60 brd ff:ff:ff:ff:ff:ff 4: eno50332184: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:19:ce:6a brd ff:ff:ff:ff:ff:ff inet 10.0.0.100/24 brd 10.0.0.255 scope global eno50332184 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe19:ce6a/64 scope link valid_lft forever preferred_lft forever
vmnet8网卡配置为如下:(DNS是通过宿主网卡属性信息或者ipconfig /all查到的)
[[email protected] ~]# 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
修改完后重启网卡:
[[email protected] ~]# systemctl restart network
重启后直接用SecureCRT登录模板机后,再进行如下操作:
vmnet1网卡配置如下:
[[email protected] ~]# 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网卡配置如下:
[[email protected] ~]# 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
重启网卡
[[email protected] ~]# systemctl restart network [[email protected] ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:19:ce:56 brd ff:ff:ff:ff:ff:ff inet 10.1.1.120/24 brd 10.1.1.255 scope global eno16777736 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe19:ce56/64 scope link valid_lft forever preferred_lft forever 3: eno33554960: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:19:ce:60 brd ff:ff:ff:ff:ff:ff inet 10.2.2.120/24 brd 10.2.2.255 scope global eno33554960 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe19:ce60/64 scope link valid_lft forever preferred_lft forever 4: eno50332184: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:19:ce:6a brd ff:ff:ff:ff:ff:ff inet 10.0.0.100/24 brd 10.0.0.255 scope global eno50332184 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe19:ce6a/64 scope link valid_lft forever preferred_lft forever
看是否可以访问外网:ping 网关和外网baidu网址
[[email protected] ~]# ping -c4 10.0.0.2 PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data. 64 bytes from 10.0.0.2: icmp_seq=1 ttl=128 time=1.69 ms 64 bytes from 10.0.0.2: icmp_seq=2 ttl=128 time=0.645 ms 64 bytes from 10.0.0.2: icmp_seq=3 ttl=128 time=0.552 ms 64 bytes from 10.0.0.2: icmp_seq=4 ttl=128 time=1.09 ms --- 10.0.0.2 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3040ms rtt min/avg/max/mdev = 0.552/0.996/1.695/0.452 ms [[email protected] ~]# ping -c4 baidu.com PING baidu.com (123.125.114.144) 56(84) bytes of data. 64 bytes from 123.125.114.144: icmp_seq=1 ttl=128 time=123 ms 64 bytes from 123.125.114.144: icmp_seq=2 ttl=128 time=37.9 ms 64 bytes from 123.125.114.144: icmp_seq=3 ttl=128 time=37.3 ms 64 bytes from 123.125.114.144: icmp_seq=4 ttl=128 time=38.7 ms --- baidu.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3030ms rtt min/avg/max/mdev = 37.357/59.400/123.520/37.023 ms
安装常用的基础包:
[[email protected] ~]# yum install vim net-tools wget tree telnet dos2unix sysstat lrzsz nc nmap -y
修改主机名:
例如把默认主机名localhost.localdomain修改为oldboy,修改完后直接重启系统。
[[email protected] ~]# vi /etc/hostname
重启后直接关机做个快照,快照名:模板机,
一定不要执行yum update -y && reboot 否则会升级到更高的版本。
openstack ocata版本对centos 7.2以上的版本兼容性比较差,只建议用centos 7.2版本。
这里没有设置centos base源和epel源,如要设置,可以设置阿里云的yum源。
本文出自 “sandshell” 博客,请务必保留此出处http://sandshell.blog.51cto.com/9055959/1973577
以上是关于Ocata_环境初始化准备:centos 7.2模板机制作(精华)的主要内容,如果未能解决你的问题,请参考以下文章
Openstack ocata+Ceph12+centos7
keystone环境搭建(源码方式+yum方式)(ocata版本)