OpenStack部署

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站

环境需求

file

file

file

file

环境配置

①配置静态地址、主机名

vi /etc/sysconfig/network-scripts/ifcfg-eth0

BOOTPROTO=static
IPADDR=192.168.153.70
NETMASK=255.255.255.0
GATEWAY=192.168.153.2
DNS1=192.168.153.2
DNS2=8.8.8.8
ONBOOT=yes

file

在/etc/resolv.conf中添加

nameserver 114.114.114.114

file

重启网卡

systemctl restart network

②关闭(设置开机不启动)防火墙、核心防护、NetworkManager

systemctl stop firewalld
systemctl disable firewalld
systemctl stop NetworkManager
setenforce 0

file

③配置yum源

cd /etc/yum.repos.d/
mkdir repo.bak
mv *.repo repo.bak/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum -y install centos-release-openstack-train
yum clean all
yum makecache

④安装时间同步服务

同步阿里云时钟服务器(ntp1、ntp2…)、设置周期性任务及设置开机自启

yum install -y ntpdate
ntpdate ntp.aliyun.com >>/var/log/ntpdate.log
crontab -e

*/30 * * * * /usr/sbin/ntpdate ntp.aliyun.com

⑤重启、查看服务状态

reboot

⑥下载OpenStack 管理工具包、在线部署OpenStack

yum -y install openstack-packstack
packstack --allinone

file

file

⑦创建br-ex网卡配置文件

cd /etc/sysconfig/network-scripts/
cp ifcfg-eth0 ifcfg-br-ex
sed -i "100d" ifcfg-br-ex
cat <<EOF >> ifcfg-br-ex
TYPE=Ethernet
BOOTPROTO=none
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
IPADDR=172.24.4.1
PREFIX=24
EOF

systemctl restart network

ifconfig

file

⑧查看用户信息并登录

cd /root && cat keystonerc_admin

file

file

file

⑨上传镜像

在原本的openstack中只有一个镜像

file

使用xshell的文件传输将镜像文件传进去

file

file

传入完成后在命令行输入:

source keystonerc_admin
openstack image create "test" --file CentOS-7-x86_64-DVD-1810-7.6.iso --disk-format qcow2 --container-format bare --public

file

file

本文转自:https://blog.csdn.net/weixin_51613313/article/details/114379449

posted @ 2022-04-18 10:26  萌褚  阅读(401)  评论(0编辑  收藏  举报