环境规划
操作系统 | 虚拟机配置 | IP地址 | 主机名 | 虚拟机软件 | OpenStack版本 |
CentOS 7.9 | 4 CPU/8G 内存/30G 硬盘 | 192.168.0.31 | openstack | VMware WorkStation 17 | Stein |
准备安装
从阿里源下载CentOS镜像或者:
链接:https://pan.baidu.com/s/15jyPVOAHA6tafwUk863b9g?pwd=ekq5
提取码:ekq5
参考文档:OpenStack官方文档 https://docs.openstack.org/install-guide/开始部署
1.安装虚拟机
2.修改主机名
hostnamectl set-hostname openstack
3.修改IP地址
vi /etc/sysconfig/network-scripts/ifcfg-ens33#修改以下2行
BOOTPROTO="static"
ONBOOT="yes"
#增加以下4行
IPADDR=192.168.0.31
PREFIX=24
GATEWAY=192.168.0.1
DNS1=192.168.0.1
systemctl restart network
4.添加本地解析
echo "192.168.0.31 openstack" >> /etc/hosts
5.设置本机SSH免密码登录
#生成ssh密钥ssh-keygen
#添加密钥信息到~./ssh/know_hosts文件
ssh-copy-id [email protected]
6.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
7.关闭SeLinux
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
8.关闭NetworkManager服务
systemctl stop NetworkManager
systemctl disable NetworkManager
9.配置yum源
参考阿里云yum源官方文档(https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11Jpkdzb)配置yum源,完成后还需要执行yum makecache;yum -y update;reboot,本文从阿里云下载的镜像已内置yum,无需操作。10.安装常用软件
yum -y install vim bash-completion yum-utils
11.安装OpenStack Stein的yum库
yum -y install centos-release-openstack-stein
12.修改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
13.安装packstack工具
yum -y install openstack-packstack
14.安装OpenStack allinone
packstack --allinone
自动化安装时间很长,出现以下信息表示安装成功
15.查看Dashboard web页面的登录账号及密码
cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin #Dashboard登录账号
export OS_PASSWORD='8927937dewu3898d' #Dashboard登录密码
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.0.31: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
16.Dashboard web登录界面
登录方式:http://192.168.0.31标签:一键,192.168,Packstack,export,yum,openstack,OpenStack,OS From: https://www.cnblogs.com/vorn/p/17520149.html