本次搭建采用双节点安装,即 controller 控制节点和compute 计算节点
配置文件中密码为000000
虚拟机:VMwareWorkstation 16 Pro
镜像:CentOS-7-x86_64-DVD-1511.iso 和 XianDian-IaaS-v2.2.iso
虚拟机 | 地址 | 内存 | 处理器 |
---|---|---|---|
controller | 192.168.1.10 | 4G | 4 |
compute | 192.168.1.20 | 2G | 2 |
compute1 | 192.168.1.30 | 2G | 2 |
默认下一步
PS:电脑不支持,可以不选,不影响使用!
启动虚拟机
选择第一个
重启
修改名称为:controller
hostnamectl set-hostname controller
Ctl+D 退出,重新登陆
关闭防火墙,并设置开机不重启
systemctl stop firewalld
systemctl disable firewalld
配置网络
vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
重启网络:
systemctl restart network
查看IP地址:
ip a
到这里,电脑设置初步完成,可以拍摄一个快照
下载完后
如果连接不上,需要修改虚拟网络编辑器:
等待上传完成
cd /opt
mount -o loop CentOS-7-x86_64-DVD-1511.iso /mnt
创建2 个目录
mkdir /opt/centos /opt/iaas
拷贝文件
cp -rvf /mnt/* /opt/centos/
解挂
[root@controller /]# umount /mnt/
挂载
[root@controller opt]# mount -o loop XianDian-IaaS-v2.2.iso /mnt
cp -rvf /mnt/* /opt/iaas/
[root@controller opt]# umount /mnt
删除所有repo文件
[root@controller opt]# cd /etc/yum.repos.d
[root@controller yum.repos.d]# rm -rf *
新建my.repo文件
[root@controller yum.repos.d]# vi my.repo
内容如下:
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enable=1
[openstack]
name=openstack
baseurl=file:///opt/iaas/iaas-repo
gpgcheck=0
enable=1
测试:
[root@controller yum.repos.d]# yum clean all
[root@controller yum.repos.d]#yum list
正常情况(不对重头开始做):
[root@controller ~]# yum -y install vsftpd
修改匿名用户访问目录
[root@controller ~]# vi /etc/vsftpd/vsftpd.conf
添加anon_root=/opt
[root@controller ~]# systemctl restart vsftpd
[root@controller ~]# systemctl enable vsftpd
验证:ftp://192.168.1.10/
修改compute节点的ip 为192.168.1.20
hostnamectl set-hostname compute
vi /etc/sysconfig/network-scripts/ifcfg-eno16777736
[root@compute ~]# systemctl restart network
yum -y install iaas-xiandian
vi /etc/xiandian/openrc.sh
修改内容如下:
HOST_IP=192.168.1.10
HOST_NAME=controller
HOST_IP_NODE=192.168.1.20
HOST_NAME_NODE=compute
RABBIT_USER=openstack
RABBIT_PASS=000000
DB_PASS=000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000
KEYSTONE_DBPASS=000000
GLANCE_DBPASS=000000
GLANCE_PASS=000000
NOVA_DBPASS=000000
NOVA_PASS=000000
NEUTRON_DBPASS=000000
NEUTRON_PASS=000000
METADATA_SECRET=000000
#INTERFACE_NAME=enp9s0
CINDER_DBPASS=000000
CINDER_PASS=000000
TROVE_DBPASS=000000
TROVE_PASS=000000
#BLOCK_DISK=md126p4(空白分区名)
SWIFT_PASS=000000
#OBJECT_DISK=md126p5(空白分区名)
STORAGE_LOCAL_NET_IP=192.168.1.20
HEAT_DBPASS=000000
HEAT_PASS=000000
CEILOMETER_DBPASS=000000
CEILOMETER_PASS=000000
AODH_DBPASS=000000
AODH_PASS=000000
iaas-pre-host.sh
验证:
[root@compute ~]# cd /usr/local/bin
[root@compute bin]# ls
结果:
iaas-install-alarm.sh iaas-install-mysql.sh iaas-install-nova-compute.sh
iaas-install-ceilometer-compute.sh iaas-install-neutron-compute-flat.sh iaas-install-nova-controller.sh
iaas-install-ceilometer-controller.sh iaas-install-neutron-compute-gre.sh iaas-install-swift-compute.sh
iaas-install-cinder-compute.sh iaas-install-neutron-compute.sh iaas-install-swift-controller.sh
iaas-install-cinder-controller.sh iaas-install-neutron-compute-vlan.sh iaas-install-trove.sh
iaas-install-dashboard.sh iaas-install-neutron-controller-flat.sh iaas-pre-host.sh
iaas-install-glance.sh iaas-install-neutron-controller-gre.sh iaas-uninstall-all.sh
iaas-install-heat.sh iaas-install-neutron-controller.sh
iaas-install-keystone.sh iaas-install-neutron-controller-vlan.sh
controller脚本
iaas-install-mysql.sh
iaas-install-keystone.sh
iaas-install-glance.sh
iaas-install-nova-controller.sh
iaas-install-neutron-controller.sh
iaas-install-dashboard.sh
iaas-install-cinder-controller.sh
iaas-install-swift-controller.sh
controller装完再装compute
compute脚本
iaas-install-nova-compute.sh
iaas-install-neutron-compute.sh
iaas-install-cinder-compute.sh
iaas-install-swift-compute.sh
最小化部署完成,此时可以用浏览器访问:http://192.168.1.10/dashboard