
环境规划
操作系统版本 | 硬件配置 | IP 地址规划 | 主机名 | 虚拟机软件 |
---|---|---|---|---|
centos7.9 | 4vCPUS/8G 30G 硬盘 | 172.17.2.60/24 | openstack | VMware WorkStation16 |
centos7.9 镜像获取地址:http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
准备资料
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
关闭 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 Stein
的yum
库
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


扫描二维码获取
更多精彩

带米的笨老头
往期推荐
原文始发于微信公众号(带米的笨老头):
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/20776.html