本配置采用两台虚拟机

虚拟机

IP地址

网关

openstack

192.168.154.101/24

192.168.154.2

yum

192.168.154.100/24


镜像下载点击——实验所需镜像

统一安装配置:

openstack一键部署配置_html



openstack一键部署配置_centos_02

openstack一键部署配置_html_03

openstack一键部署配置_linux_04

openstack一键部署配置_linux_05

openstack配置:

修改主机名:

hostnamectl set-hostname train

bash

openstack一键部署配置_linux_06

配置网卡信息:

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

openstack一键部署配置_html_07

配置好ip然后重启网卡打开自己的主机电脑ping一下刚刚配置的地址查看是否通信:

打开自己电脑命令提示符ping 192.168.154.101

openstack一键部署配置_centos_08

关闭防火墙和网络管理:

systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager

openstack一键部署配置_linux_09

查看防火墙和网络管理状态:

systemctl status firewalld NetworkManager

openstack一键部署配置_linux_10

关闭SELINUX:

setenforce 0
getenforce

openstack一键部署配置_linux_11


vi /etc/selinux/config

SELINUX=disabled

或者:

sed -i '/^SELINUX/s/enforcing/disabled/' /etc/selinux/config

openstack一键部署配置_html_12

修改主机记录:

vi /etc/hosts

192.168.154.101 train

或者:

echo '192.168.154.101 train'>> /etc/hosts

openstack一键部署配置_html_13

使用国内源:

yum install centos-release-openstack-train -y

openstack一键部署配置_html_14

进入到yum目录进行查看:

cd /etc/yum.repos.d/

ll

openstack一键部署配置_html_15

编辑修改配置[第8行的baseurl]:

vi CentOS-OpenStack-train.repo

baseurl=http://mirrors.163.com/centos/7.9.2003/cloud/x86_64/openstack-train/

或者:

sed -i '8a baseurl=http://mirrors.163.com/centos/7.9.2003/cloud/x86_64/openstack-train/' /etc/yum.repos.d/CentOS-OpenStack-train.repo

openstack一键部署配置_centos_16

进行源更新:

yum clean all
yum makecache
yum repolist

创建本地源:

yum -y install vim reposync createrepo yum-utils httpd net-tools

yum -y install centos-release-openstack-train

查看:

ls -l /etc/yum.repos.d/

openstack一键部署配置_centos_17

yum repolist

创建:

mkdir /var/www/html/yumrepository

执行:

reposync -p /var/www/html/yumrepository/

openstack一键部署配置_linux_18

这里执行完成预计一个小时左右(根据自身网络快慢决定)所以接下来先配置yum虚拟主机:

yum主机配置:

修改主机名:

hostnamectl set-hostname yum

bash

openstack一键部署配置_centos_19

配置ip地址:

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

openstack一键部署配置_linux_20

重启网卡查看ip:

systemctl restart network

ip address

openstack一键部署配置_centos_21

用自己主机的命令提示符与yum主机进行通信查看:

ping 192.168.154.100

openstack一键部署配置_html_22

关闭防火墙和网络管理:

systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager

关闭SELINUX:

setenforce 0
getenforce
vi /etc/selinux/config

SELINUX=disabled

或者:

sed -i '/^SELINUX/s/enforcing/disabled/' /etc/selinux/config

修改主机记录:

vi /etc/hosts

192.168.154.100 train

或者:

echo '192.168.154.100 train'>> /etc/hosts

安装open stack:

yum install centos-release-openstack-train -y

openstack一键部署配置_html_23

安装插件:

yum -y install vim reposync createrepo yum-utils httpd net-tools

进行创建本地源:

ls -l /etc/yum.repos.d/

yum repolist
mkdir /var/www/html/yumrepository

reposync -p /var/www/html/yumrepository/

ll /var/www/html/yumrepository/

有点慢等待安装即可:

然后进入目录执行:

cd /var/www/html/yumrepository
cd ./base
createrepo .
cd ../centos-ceph-nautilus
createrepo .
cd ../centos-nfs-ganesha28
createrepo .
cd ../centos-openstack-train
createrepo .
cd ../centos-qemu-ev
createrepo .
cd ../extras
createrepo .
cd ../updates
createrepo .
cd ..
reposync -p /var/www/html/yumrepository/
createrepo --update .

配置服务器关闭防火墙:

systemctl start httpd
systemctl enable httpd
systemctl status httpd
systemctl stop firewalld NetworkManager.service
systemctl disable firewalld NetworkManager.service
systemctl status firewalld NetworkManager.service
setenforce 0

进行源更新:

yum clean all
yum makecache

以上则是yum主机配置全部正常执行无报错即可。

openstack配置2:

经过长时间等待ok之后查看一下:

ll /var/www/html/yumrepository/

openstack一键部署配置_linux_24

进入:

cd /var/www/html/yumrepository

进行本地制作:

cd ./base
createrepo .
cd ../centos-ceph-nautilus
createrepo .
cd ../centos-nfs-ganesha28
createrepo .
cd ../centos-openstack-train
createrepo .
cd ../centos-qemu-ev
createrepo .
cd ../extras
createrepo .
cd ../updates
createrepo .
cd ..
reposync -p /var/www/html/yumrepository/
createrepo --update .

openstack一键部署配置_centos_25

openstack一键部署配置_linux_26

openstack一键部署配置_linux_27

配置服务器及关闭防火墙和网络管理:

systemctl start httpd
systemctl enable httpd
systemctl status httpd
systemctl stop firewalld NetworkManager.service
systemctl disable firewalld NetworkManager.service
systemctl status firewalld NetworkManager.service
setenforce 0

openstack一键部署配置_linux_28

配置使用本地源:

移除原系统自带的repo文件,避免和新建的配置文件发生冲突:

mkdir ori_repo-config
mv /etc/yum.repos.d/* ./ori_repo-config/

openstack一键部署配置_linux_29

新建一个名为CentOS-PrivateLocal的repo:

touch /etc/yum.repos.d/CentOS-PrivateLocal.repo

进行操作输入地址为yum主机地址:

cat <<EOF> /etc/yum.repos.d/CentOS-PrivateLocal.repo

[base]
name=CentOS-$releasever - Base
baseurl=http://192.168.154.100/yumrepository/base/
gpgcheck=0
enabled=1
[updates]
name=CentOS-$releasever - Updates
baseurl=http://192.168.154.100/yumrepository/updates/
gpgcheck=0
enabled=1
[extras]
name=CentOS-$releasever - Extras
baseurl=http://192.168.154.100/yumrepository/extras/
gpgcheck=0
enabled=1
[centos-openstack-train]
name=CentOS-7 - OpenStack train
baseurl=http://192.168.154.100/yumrepository/centos-openstack-train/
gpgcheck=0
enabled=1
[centos-qemu-ev]
name=CentOS-$releasever - QEMU EV
baseurl=http://192.168.154.100/yumrepository/centos-qemu-ev/
gpgcheck=0
enabled=1
[centos-ceph-nautilus]
name=CentOS-7 - Ceph Nautilus
baseurl=http://192.168.154.100/yumrepository/centos-ceph-nautilus/
gpgcheck=0
enabled=1
[centos-nfs-ganesha28]
name=CentOS-7 - NFS Ganesha 2.8
baseurl=http://192.168.154.100/yumrepository/centos-nfs-ganesha28/
gpgcheck=0
enabled=1
EOF

openstack一键部署配置_linux_30

openstack一键部署配置_linux_31

源更新:

yum clean all
yum makecache

一键安装Openstack系统“

安装软件包:

yum install openstack-packstack -y

一键部署packstack

packstack --allinone

然后等待15分钟左右即可去浏览器访问本机ip/dashbord

http://192.168.154.101/dashbord

openstack一键部署配置_html_32

查看密码进行登录:

cat keystonerc_admin

openstack一键部署配置_centos_33

进行登录:

openstack一键部署配置_linux_34

openstack一键部署配置_html_35

ok了部署成功