目录
本文记录了基于CentOS操作系统使用packstack快速部署openstack。
资源列表
操作系统 | 配置 | 磁盘 | IP | 数量 |
---|---|---|---|---|
CentOS7.9 | 4C8G | 50G | 192.168.207.155 | 1 |
基础环境
-
服务器开启虚拟化,我这里使用的是VMware虚拟机,所以勾选 虚拟化Intel VT-x/EPT或AMD-V/RVI(V)
-
关闭防火墙
bash
systemctl stop firewalld
systemctl disable firewalld
- 关闭内核安全机制
bash
sed -i "s/.*SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config
- 修改IP为静态IP,若已经是静态IP可以跳过
bash
nmcli con mod ens33 ipv4.method static ipv4.address 192.168.207.155/24 ipv4.gateway 192.168.207.2 ipv4.dns 192.168.207.2
- 修改主机名
bash
# 注意这里修改的主机名不能有下划线
hostnamectl set-hostname openstack
- 关闭NetworkManager
bash
systemctl stop NetworkManager
systemctl disable NetworkManager
- 添加hosts
bash
echo "192.168.207.155 openstack" >> /etc/hosts
- 重启服务器
bash
reboot
安装packstack
bash
# 更新软件包
yum -y update
# 安装train版本包
yum -y install centos-release-openstack-train
# 安装packstack
yum -y install openstack-packstack
安装OpenStack
bash
# 该过程耗时较长,约30分钟左右
packstack --allinone
# 出现以下信息表示成功
**** Installation completed successfully ******
Additional information:
- Parameter CONFIG_NEUTRON_L2_AGENT: You have chosen OVN Neutron backend. Note that this backend does not support the VPNaaS or FWaaS services. Geneve will be used as the encapsulation method for tenant networks
- A new answerfile was created in: /root/packstack-answers-20200221-143136.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 192.168.207.131. To use the command line tools you need to source the file.
- To access the OpenStack Dashboard browse to http://192.168.207.131/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/20200221-143136-tbr4ug/openstack-setup.log
- The generated manifests are available at: /var/tmp/packstack/20200221-143136-tbr4ug/manifests
# 查看keystonerc_admin文件获取账号密码(通常在用户的家目录)
# 以此为例用户就是admin,密码则是4dc0395edf0a4fe7
[root@openstack ~]# cat /root/keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD='4dc0395edf0a4fe7'
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.247.3: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
如果有问题的可以使用该命令指定应答文件再次执行
bash
packstack --answer-file=[应答文件]
在安装完openstack以后会有一个br-ex网卡这个是临时的需要写个配置文件
bash
[root@openstack ]# ifconfig br-ex
br-ex: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.24.4.1 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::5cde:dcff:fe75:fb43 prefixlen 64 scopeid 0x20<link>
ether 5e:de:dc:75:fb:43 txqueuelen 1000 (Ethernet)
RX packets 15 bytes 420 (420.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 648 (648.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@openstack network-scripts]# cat ifcfg-br-ex
TYPE=Ethernet
BOOTPROTO=none
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
IPADDR=172.24.4.1
PREFIX=24
查看openstack相关服务
bash
yum -y install openstack-utils
openstack-service --help
openstack-service list
openstack-service restart openstack-swift-proxy