使用Packstack工具一键安装OpenStack,openstack快速部署

环境规划

操作系统版本硬件配置IP地址规划主机名虚拟机软件OpenStack版本
centos7.94vCPUS/8G 30G硬盘172.17.2.60/24openstackVMware WorkStation16Stein

centos7.9镜像获取地址:
链接:https://pan.baidu.com/s/11fxnAyr9xPinN2Yq56Ujxg
提取码:1314

准备资料

OpenStack官方文档:https://docs.openstack.org/install-guide/

使用Packstack一键部署OpenStack的方式,隐藏了技术细节,如果使用中出来任何问题,我们都无法解决,所以体验完OpenStack的日常界面操作后,后期还是要仔细查看官方文档,然后一步步手工安装OpenStack各组件。

阿里云yum源设置官方文档:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11Jpkdzb

部署过程

修改centos系统的主机名

hostnamectl set-hostname openstack

设置centos系统为静态IP地址

#注意修改自己的网卡配置文件
vi /etc/sysconfig/network-scripts/ifcfg-ens32
#重启网络服务
systemctl restart network
#验证IP地址
ip addr

添加主机hosts记录

echo "172.17.2.60 openstack" >> /etc/hosts
#验证修改结果
more /etc/hosts

设置本机SSH免密码登录

#生成ssh密钥
ssh-keygen
#添加密钥信息到~./ssh/know_hosts文件
ssh-copy-id root@172.17.2.60

关闭防火墙

systemctl stop firewalld
systemctl disable firewalld
#查看防火墙状态
systemctl status firewalld

关闭SeLinux

setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

#c
 systemctl status firewalld
  getenforce

关闭NetworkManager服务

systemctl stop NetworkManager
systemctl disable NetworkManager
#查看NetworkManager状态
systemctl status NetworkManager

修改官方yum源为阿里云yum源

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#重建本地yum索引缓存
yum makecache

系统升级

#升级
yum -y update
#重启
reboot

安装常用软件

 yum -y install vim bash-completion yum-utils

安装OpenStack Steinyum

yum -y install centos-release-openstack-stein

修改CentOS-OpenStack-stein.repo配置文件

cd /etc/yum.repos.d/
#备份
cp -a CentOS-OpenStack-stein.repo CentOS-OpenStack-stein.repo.bak

#修改配置文件
vim CentOS-OpenStack-stein.repo
[centos-openstack-stein]
baseurl=http://mirrors.aliyun.com/$contentdir/$releasever/cloud/$basearch/openstack-stein/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=cloud-openstack-stein
...

#清除本地yum索引缓存,然后再重建索引缓存
yum clean all && yum makecache

安装packstack工具

yum -y install openstack-packstack

安装OpenStack allinone

packstack --allinone

自动化安装时间很长,静静等待,直到出现如下信息,表示成功安装。

**** Installation completed successfully ******

Additional information:
 * Parameter CONFIG_NEUTRON_L2_AGENT: You have choosen OVN neutron backend. Note that this backend does not support LBaaS, VPNaaS or FWaaS services. Geneve will be used as encapsulation method for tenant networks
 * A new answerfile was created in: /root/packstack-answers-20220222-171022.txt
 * Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
 * File /root/keystonerc_admin has been created on OpenStack client host 172.17.2.60. To use the command line tools you need to source the file.
 * To access the OpenStack Dashboard browse to http://172.17.2.60/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
 * The installation log file is available at: /var/tmp/packstack/20220222-171021-YFXtB3/openstack-setup.log
 * The generated manifests are available at: /var/tmp/packstack/20220222-171021-YFXtB3/manifests

查看Dashboard web页面的登录账号及密码

cat keystonerc_admin 
unset OS_SERVICE_TOKEN
    export OS_USERNAME=admin		#Dashboard登录账号
    export OS_PASSWORD='12b2ca7e963242ae'	#Dashboard登录密码
    export OS_REGION_NAME=RegionOne
    export OS_AUTH_URL=http://172.17.2.60:5000/v3
    export PS1='[\u@\h \W(keystone_admin)]\$ '
    
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3

Dashboard web登录界面

登录方式:http://172.17.2.60
在这里插入图片描述

修改Dashboard登录密码

使用新密码重新登录

为以后的实验过程,同时需要修改keystonerc_admin文件中的OS_PASSWORD变量,换成新密码,如下:

vim keystonerc_admin
export OS_PASSWORD='admin'	#填入修改后的新密码

附:安装过程中的错误及解决办法

错误1:ERROR : Failed to run remote script, stdout:

stderr: Warning: Permanently added ‘172.17.2.60’ (ECDSA) to the list of known hosts.

解决办法:

ssh-kengen
ssh-copy-id root@172.17.2.60

错误2:facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory

原因:启用了epel库导致的

解决办法:

#1.禁用epel
yum-config-manager --disable epel
#2.清理yum索引缓存
yum clean all
#3.重建yum索引缓存
yum makecache
#4.降级leatherman
yum downgrade leatherman
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐