openstack一键部署配置
原创
©著作权归作者所有:来自51CTO博客作者冷影玺的原创作品,请联系作者获取转载授权,否则将追究法律责任
本配置采用两台虚拟机
虚拟机 | IP地址 | 网关 |
openstack | 192.168.154.101/24 | 192.168.154.2 |
yum | 192.168.154.100/24 |
|
镜像下载点击——实验所需镜像
统一安装配置:
openstack配置:
修改主机名:
hostnamectl set-hostname train
bash
配置网卡信息:
vi /etc/sysconfig/network-scripts/ifcfg-ens33
配置好ip然后重启网卡打开自己的主机电脑ping一下刚刚配置的地址查看是否通信:
打开自己电脑命令提示符ping 192.168.154.101
关闭防火墙和网络管理:
systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager
查看防火墙和网络管理状态:
systemctl status firewalld NetworkManager
关闭SELINUX:
vi /etc/selinux/config
SELINUX=disabled
或者:
sed -i '/^SELINUX/s/enforcing/disabled/' /etc/selinux/config
修改主机记录:
vi /etc/hosts
192.168.154.101 train
或者:
echo '192.168.154.101 train'>> /etc/hosts
使用国内源:
yum install centos-release-openstack-train -y
进入到yum目录进行查看:
编辑修改配置[第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
进行源更新:
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
查看:
创建:
mkdir /var/www/html/yumrepository
执行:
reposync -p /var/www/html/yumrepository/
这里执行完成预计一个小时左右(根据自身网络快慢决定)所以接下来先配置yum虚拟主机:
yum主机配置:
修改主机名:
hostnamectl set-hostname yum
bash
配置ip地址:
vi /etc/sysconfig/network-scripts/ifcfg-ens33
重启网卡查看ip:
systemctl restart network
ip address
用自己主机的命令提示符与yum主机进行通信查看:
关闭防火墙和网络管理:
systemctl disable firewalld
systemctl stop firewalld
systemctl disable NetworkManager
systemctl stop NetworkManager
关闭SELINUX:
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
安装插件:
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/
进入:
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
配置使用本地源:
移除原系统自带的repo文件,避免和新建的配置文件发生冲突:
mkdir ori_repo-config
mv /etc/yum.repos.d/* ./ori_repo-config/
新建一个名为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
源更新:
yum clean all
yum makecache
一键安装Openstack系统“
安装软件包:
yum install openstack-packstack -y
一键部署packstack
然后等待15分钟左右即可去浏览器访问本机ip/dashbord
http://192.168.154.101/dashbord
查看密码进行登录:
进行登录:
ok了部署成功