美文网首页
使用Packstack搭建OpenStack

使用Packstack搭建OpenStack

作者: jan29 | 来源:发表于2021-01-13 19:15 被阅读0次

一、简介

  • 本次实验环境搭建使用一台物理主机

    操作系统 节点 主机名 IP地址 网卡
    centos7.6 控制节点/网络节点 controller 192.168.200.200 ens33
  • 本次环境涉及到的密码全部为000000

二、基础环境搭建

  • 1、系统配置

image.png

预留一部分磁盘给cinder,swift服务使用

image.png

提前安装虚拟化系统工具

  • 2、更改主机名

[root@localhost ~]# hostnamectl set-hostname controller
  • 3、修改/etc/hosts文件

[root@controller ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain
  4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain
  6
192.168.200.200 controller

  • 4、关闭防火墙和SELINUX

[root@controller ~]# systemctl stop firewalld && systemctl disable firewalld
[root@controller ~]# setenforce 0
[root@controller ~]# vim /etc/selinux/config 
SELINUX=disabled
  • 5、配置节点无密登陆

[root@controller ~]# ssh-keygen 
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
[root@controller ~]# ssh-copy-id root@192.168.200.200
  • 6、配置网络YUN源

[root@controller ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
[root@controller ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
[root@controller ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

替换第三方源。更多源下载请访问:https://developer.aliyun.com/mirror/

三、使用packstack安装openstack

  • 1、配置openstack源

[root@controller yum.repos.d]# vim openstack.repo
[openstack]
name=openstack
baseurl=http://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-stein/
enable=1
gpgcheck=0
[root@controller yum.repos.d]# vim virt.repo
[virt]
name=virt
baseurl=http://mirrors.aliyun.com/centos/7/virt/x86_64/kvm-common/
enable=1
gpgcheck=0

如果后期安装报错,请配置virt源,用以解决qemu-kvm-rhev 版本低于2.10.0

ERROR : Error appeared during Puppet run: 192.168.200.200_compute.pp
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install openstack-nova-migration' returned 1: Error: Package: 1:openstack-nova-compute-18.3.0-1.el7.noarch (openstack)
You will find full trace in log /var/tmp/packstack/20210113-164936-YwkWij/manifests/192.168.200.200_compute.pp.log
  • 2、安装openstack-packstack工具

yum install kernel* -y 
yum install openstack-packstack -y 
  • 3、生成应答文件

[root@controller ~]# packstack --gen-answer-file=demo --default-password=000000
[root@controller ~]# cp demo demo-all
  • 4、配置应答文件

[root@controller ~]# vim demo-all
CONFIG_NEUTRON_L3_EXT_BRIDGE=br-ex
CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat,gre,vlan
CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch,linuxbridge
CONFIG_NEUTRON_ML2_FLAT_NETWORKS=external
CONFIG_NEUTRON_ML2_VNI_RANGES=1:1000
CONFIG_NEUTRON_L2_AGENT=openvswitch
CONFIG_NEUTRON_ML2_SRIOV_INTERFACE_MAPPINGS=external:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=external:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:ens33
  • 5、开始部署

[root@controller ~]# yum -y downgrade leatherman
[root@controller ~]# packstack --answer-file=demo-all

我们需要降级软件包 leatherman,来解决软件兼容性问题

  • 6、验证

在本机关闭防火哦,输入192.168.200.200/dashboard 进行访问登陆。


image.png

相关文章

网友评论

      本文标题:使用Packstack搭建OpenStack

      本文链接:https://www.haomeiwen.com/subject/zscpaktx.html