1.基础环境准备

禁用selinx、卸载firewalld和NetworkManager

配置/etc/hosts解析主机名

检查主机yum源,4个仓库,10670个软件包

检查依赖软件是否安装

检查NTP服务器是否正常可用

检查/etc/resolv.conf不能有search开头的行

结果如下所示:

[root@openstack ~]# yum repolist

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

源标识 源名称 状态

!1804 Centos1804 9,911

!extras extras 76

!openstack-devtools openstack 3

!openstack-rpms openstack 680

repolist: 10,670

[root@openstack ~]# chronyc sources -v

210 Number of sources = 1


.-- Source mode '^' = server, '=' = peer, '#' = local clock.

/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,

| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.

|| .- xxxx [ yyyy ] +/- zzzz

|| Reachability register (octal) -. | xxxx = adjusted offset,

|| Log2(Polling interval) --. | | yyyy = measured offset,

|| \ | | zzzz = estimated error.

|| | | \

MS Name/IP address Stratum Poll Reach LastRx Last sample

===============================================================================

^* 176.233.13.179 3 10 377 410 -244us[ -338us] +/- 26ms

[root@openstack ~]# cat /etc/yum.repos.d/local.repo

[1804]

name=Centos1804

baseurl=ftp://176.233.13.179/centos-1804

gpgcheck=0

enabled=1


[extras]

name=extras

baseurl=ftp://176.233.13.179/extras

gpgcheck=0

enabled=1


[openstack-rpms]

name=openstack

baseurl=ftp://176.233.13.179/openstack/rhel-7-server-openstack-10-rpms

gpgcheck=0

enabled=1


[openstack-devtools]

name=openstack

baseurl=ftp://176.233.13.179/openstack/rhel-7-server-openstack-10-devtools-rpms

gpgcheck=0

enabled=1

2.Packstack服务配置软件安装

      控制节点安装软件
      yum -y install openstack-packstack python-setuptools
    Nova节点安装软件包
    yum -y install pyton-setuptools libvirt-daemon libvirt-daemon-driver-qemu libvirt-client qemu-kvm

3.配置packstack应答文件生成配置文件

packstack --gen-answer-file=answer.ini
使用vim修改配置文件后如下:
[root@openstack ~]# sed -n "42p;45p;49p;53p;75p;98p;102p;333p;840p;910p;921p;1179p;" anwer.ini
CONFIG_SWIFT_INSTALL=n #是否安装swift组件
CONFIG_CEILOMETER_INSTALL=n #45、49、53为计费相关模块
CONFIG_AODH_INSTALL=n
CONFIG_GNOCCHI_INSTALL=n
CONFIG_NTP_SERVERS=176.233.13.179 #NTP时间服务器地址
CONFIG_COMPUTE_HOSTS=192.168.10.11 #nova组件ip地址
CONFIG_NETWORK_HOSTS=192.168.10.10,192.168.10.11 #Neutron组件安装地址,所有节点都需要安装
CONFIG_KEYSTONE_ADMIN_PW=123 #设置管理员密码
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat #配置支持的网络协议
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex #ovs网桥名称
CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0 #网桥物理网卡接口
CONFIG_PROVISION_DEMO=n #演示案例设置

4.安装openstack如下

packstack --answer-file=answer.ini需要持续20~30分钟不等

Openstack安装过程精讲_安装软件


Openstack安装过程精讲_Source_02


安装过程如果网络被重置,出现报错,需要手动修改网卡,命令如下:

[root@openstack ~]# cat /etc/sysconfig/network-scripts/ifcfg-br-ex

ONBOOT=yes

PEERDNS=no

NM_CONTROLLED=no

IPADDR="192.168.10.10"

NETMASK="255.255.255.0"

GATEWAY="192.168.10.2"

DEVICE=br-ex

NAME=br-ex

DEVICETYPE=ovs

OVSBOOTPROTO="static"

TYPE=OVSBridge

重新执行安装命令

[root@openstack ~]# packstack --answer-file=answer.ini

Openstack安装过程精讲_Source_03


5.执行成功后可以测试登录openstack

Openstack安装过程精讲_安装软件_04


登录成功如下:

Openstack安装过程精讲_配置文件_05