使用VMware Workstation搭建先电IaaS2.4云平台(二)

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: 使用VMware Workstation搭建先电IaaS2.4云平台(二)

7、上传所需镜像文件并进行挂载测试

【controller】

[root@controller ~]# ll
total 8075368
-rw-------. 1 root root       1381 Oct 18 14:22 anaconda-ks.cfg
-rw-r--r--. 1 root root 4470079488 Nov 14 17:53 CentOS-7-x86_64-DVD-1804.iso
-rw-r--r--. 1 root root 3799093248 Nov 14 18:00 chinaskills_cloud_iaas.iso
[root@controller ~]# mount -o loop CentOS-7-x86_64-DVD-1804.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# cp -rf /mnt/* /opt/centos/
[root@controller ~]# umount /mnt/
[root@controller ~]# mount -o loop chinaskills_cloud_iaas.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only
[root@controller ~]# cp -rf /mnt/* /opt/openstack/
[root@controller ~]# umount /mnt/

测试镜像是否设置成功

[root@controller ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: centos openstack
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
[root@controller ~]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
centos                                                                                                 | 3.6 kB  00:00:00     
openstack                                                                                              | 2.9 kB  00:00:00     
(1/3): centos/primary_db                                                                               | 3.1 MB  00:00:00     
(2/3): centos/group_gz                                                                                 | 166 kB  00:00:00     
(3/3): openstack/primary_db                                                                            | 1.4 MB  00:00:00     
repo id                                                     repo name                                                   statuscentos                                                      centos                                                      3,971
openstack                                                   openstack                                                   3,232
repolist: 7,203
[root@controller ~]# 

安装http服务

[root@controller ~]# yum install -y httpd
[root@controller ~]# systemctl start httpd && systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@controller ~]# ln -s /opt/ /var/www/html/
[root@controller ~]# cd /var/www/html/
[root@controller html]# ll
total 0
lrwxrwxrwx 1 root root 5 Nov 15 02:30 opt -> /opt/
[root@controller html]# 

20201115023146126.png【compute】

[root@compute ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: centos openstack
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
[root@compute ~]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
centos                                                                                                 | 3.6 kB  00:00:00     
openstack                                                                                              | 2.9 kB  00:00:00     
(1/3): centos/group_gz                                                                                 | 166 kB  00:00:00     
(2/3): openstack/primary_db                                                                            | 1.4 MB  00:00:00     
(3/3): centos/primary_db                                                                               | 3.1 MB  00:00:00     
repo id                                                     repo name                                                   statuscentos                                                      centos                                                      3,971
openstack                                                   openstack                                                   3,232
repolist: 7,203
[root@compute ~]# 


8、YUM源安装并修改opensrc.sh配置文件

【controller】

[root@controller ~]# yum install -y iaas-xiandian

[root@controller ~]# vi /etc/xiandian/openrc.sh

在命令模式下执行此命令:%s/^.//g用于删除#

在命令模式下执行此命令:%s/PASS=/PASS=000000/g用于编写PASS

在编辑模式下,按q进入到命令模式

[root@controller ~]# cat /etc/xiandian/openrc.sh 
#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=172.16.10.10
#Controller HOST Password. example:000000 
HOST_PASS=000000
#Controller Server hostname. example:controller
HOST_NAME=controller
#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=172.16.10.20
#Compute HOST Password. example:000000 
HOST_PASS_NODE=000000
#Compute Node hostname. example:compute
HOST_NAME_NODE=compute
#--------------------Chrony Config-------------------##
#Controller network segment IP.  example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=172.16.10.0/24
#--------------------Rabbit Config ------------------##
#user for rabbit. example:openstack
RABBIT_USER=openstack
#Password for rabbit user .example:000000
RABBIT_PASS=000000
#--------------------MySQL Config---------------------##
#Password for MySQL root user . exmaple:000000
DB_PASS=000000
#--------------------Keystone Config------------------##
#Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000
#Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000
#--------------------Glance Config--------------------##
#Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000
#Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000
#--------------------Nova Config----------------------##
#Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000
#Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000
#--------------------Neturon Config-------------------##
#Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000
#Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000
#metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000
#Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=172.16.10.10
#External Network Interface. example:eth1
INTERFACE_NAME=ens34
#External Network The Physical Adapter. example:provider
Physical_NAME=provider
#First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=1
#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=2000
#--------------------Cinder Config--------------------##
#Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000
#Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000
#Cinder Block Disk. example:md126p3
BLOCK_DISK=sdb
#--------------------Swift Config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdc
#The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=172.16.10.20
#--------------------Heat Config----------------------##
#Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000
#Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000
#--------------------Zun Config-----------------------##
#Password for Mysql Zun user. exmaple:000000
ZUN_DBPASS=000000
#Password for Keystore Zun user. exmaple:000000
ZUN_PASS=000000
#Password for Mysql Kuryr user. exmaple:000000
KURYR_DBPASS=000000
#Password for Keystore Kuryr user. exmaple:000000
KURYR_PASS=000000
#--------------------Ceilometer Config----------------##
#Password for Gnocchi ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000
#Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000
#--------------------AODH Config----------------##
#Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000
#Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000
#--------------------Barbican Config----------------##
#Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=000000
#Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=000000

将controller配置好的openrc.sh通过scp传输至compute相应的文件夹内

[root@controller ~]# scp /etc/xiandian/openrc.sh 172.16.19.20:/etc/xiandian/openrc.sh 
ssh: connect to host 172.16.19.20 port 22: No route to host
lost connection
[root@controller ~]# scp /etc/xiandian/openrc.sh 172.16.10.20:/etc/xiandian/openrc.sh 
The authenticity of host '172.16.10.20 (172.16.10.20)' can't be established.
ECDSA key fingerprint is SHA256:lDjv6aHOHM9bz6LzO/u3DT4AMGxP56xSw5VGt9YVco0.
ECDSA key fingerprint is MD5:11:8a:16:1d:cb:78:26:35:c7:87:1b:81:d3:fa:e2:fb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.10.20' (ECDSA) to the list of known hosts.
root@172.16.10.20's password: 
openrc.sh                                                                                   100% 3807     1.8MB/s   00:00    
[root@controller ~]# 

【compute】

[root@compute ~]# vi /etc/xiandian/openrc.sh 
[root@compute ~]# cat /etc/xiandian/openrc.sh 
#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=172.16.10.10
#Controller HOST Password. example:000000 
HOST_PASS=000000
#Controller Server hostname. example:controller
HOST_NAME=controller
#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=172.16.10.20
#Compute HOST Password. example:000000 
HOST_PASS_NODE=000000
#Compute Node hostname. example:compute
HOST_NAME_NODE=compute
#--------------------Chrony Config-------------------##
#Controller network segment IP.  example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=172.16.10.0/24
#--------------------Rabbit Config ------------------##
#user for rabbit. example:openstack
RABBIT_USER=openstack
#Password for rabbit user .example:000000
RABBIT_PASS=000000
#--------------------MySQL Config---------------------##
#Password for MySQL root user . exmaple:000000
DB_PASS=000000
#--------------------Keystone Config------------------##
#Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000
#Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000
#--------------------Glance Config--------------------##
#Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000
#Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000
#--------------------Nova Config----------------------##
#Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000
#Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000
#--------------------Neturon Config-------------------##
#Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000
#Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000
#metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000
#Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=172.16.10.20
#External Network Interface. example:eth1
INTERFACE_NAME=ens34
#External Network The Physical Adapter. example:provider
Physical_NAME=provider
#First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=1
#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=2000
#--------------------Cinder Config--------------------##
#Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000
#Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000
#Cinder Block Disk. example:md126p3
BLOCK_DISK=sdb
#--------------------Swift Config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdc
#The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=172.16.10.20
#--------------------Heat Config----------------------##
#Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=000000
#Password for Keystore heat user. exmaple:000000
HEAT_PASS=000000
#--------------------Zun Config-----------------------##
#Password for Mysql Zun user. exmaple:000000
ZUN_DBPASS=000000
#Password for Keystore Zun user. exmaple:000000
ZUN_PASS=000000
#Password for Mysql Kuryr user. exmaple:000000
KURYR_DBPASS=000000
#Password for Keystore Kuryr user. exmaple:000000
KURYR_PASS=000000
#--------------------Ceilometer Config----------------##
#Password for Gnocchi ceilometer user. exmaple:000000
CEILOMETER_DBPASS=000000
#Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=000000
#--------------------AODH Config----------------##
#Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=000000
#Password for Keystore AODH user. exmaple:000000
AODH_PASS=000000
#--------------------Barbican Config----------------##
#Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=000000
#Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=000000


9、执行相关服务部署脚本

【controller| compute】

# iaas-pre-host.sh 
# reboot

等到controller、compute两个节点同时创建完成后再同时重启centos


Please Reboot or Reconnect the terminal当同时在两个节点看到此提示,即可重启。


【controller】

安装数据库服务

[root@controller ~]# iaas-install-mysql.sh

20201115115911995.png

安装认证服务

[root@controller ~]# iaas-install-keystone.sh

验证认证服务

[root@controller ~]# source /etc/keystone/admin-openrc.sh 
[root@controller ~]# openstack user list
+----------------------------------+-------+
| ID                               | Name  |
+----------------------------------+-------+
| cac753e558c747338116623b8de8de42 | admin |
| e6a51892258b45c79c28ae7e10127a80 | demo  |
+----------------------------------+-------+

安装镜像服务

[root@controller ~]# iaas-install-glance.sh


验证镜像服务

[root@controller ~]# openstack user list

±---------------------------------±-------+

| ID | Name |

±---------------------------------±-------+

| 7c33302f61cf4b85b09f6cf4d91598e5 | glance |

| cac753e558c747338116623b8de8de42 | admin |

| e6a51892258b45c79c28ae7e10127a80 | demo |

±---------------------------------±-------+


上传测试镜像

[root@controller ~]# source /etc/keystone/admin-openrc.sh 
[root@controller ~]# glance image-create --name cirros --disk-format qcow2 --container bare --progress < cirros-0.5.1-x86_64-disk.img 
[=============================>] 100%
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 1d3062cd89af34e419f7100277f38b2b     |
| container_format | bare                                 |
| created_at       | 2020-11-15T04:06:20Z                 |
| disk_format      | qcow2                                |
| id               | 1fea3777-e5ed-46b7-9dae-2d9a3554bb99 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | cirros                               |
| owner            | b80d6a7fd05641aea59268fc30775ed5     |
| protected        | False                                |
| size             | 16338944                             |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2020-11-15T04:06:21Z                 |
| virtual_size     | None                                 |
| visibility       | shared                               |
+------------------+--------------------------------------+
[root@controller ~]# openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| 1fea3777-e5ed-46b7-9dae-2d9a3554bb99 | cirros | active |
+--------------------------------------+--------+--------+

安装计算服务

[root@controller ~]# iaas-install-nova-controller.sh

20201115120958646.png

验证计算服务

[root@controller ~]# openstack user list
+----------------------------------+-----------+
| ID                               | Name      |
+----------------------------------+-----------+
| 7c33302f61cf4b85b09f6cf4d91598e5 | glance    |
| 91b70a465e494ad1b438b167d4db6d2a | placement |
| 958fd8e1ba0e427fbab6e149f0a3ea1b | nova      |
| cac753e558c747338116623b8de8de42 | admin     |
| e6a51892258b45c79c28ae7e10127a80 | demo      |
+----------------------------------+-----------+

【compute】

安装计算服务

注意:等待controller控制节点计算服务脚本执行安装完毕后,再执行compute节点的安装。后面的安装亦是如此。

[root@compute ~]# iaas-install-nova-compute.sh

20201115121354547.png

【controller】

安装网络服务

[root@controller ~]# iaas-install-neutron-controller.sh


【compute】

安装网络服务

[root@compute ~]# iaas-install-neutron-compute.sh

20201115121526873.png

【controller】

安装Dashboard服务

[root@controller ~]# iaas-install-dashboard.sh

20201115121553987.png


10、登录Dashboard管理控制平台

20201115121759850.png

20201115121837823.png

至此。基础部分搭建完成!

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
3天前
|
Unix Linux 虚拟化
VMware Workstation 17.6.2 发布下载,现在完全免费无论个人还是商业用途
VMware Workstation 17.6.2 发布下载,现在完全免费无论个人还是商业用途
141 15
VMware Workstation 17.6.2 发布下载,现在完全免费无论个人还是商业用途
|
2月前
|
Linux API 虚拟化
VMware WorkStation Pro 15.5(低版本安装) 教学用
VMware WorkStation Pro 15.5(低版本安装) 教学用
227 5
|
3月前
|
运维 虚拟化 Windows
VMware Workstation常见的故障处理
关于VMware Workstation常见故障处理的指南,包括Windows 10开启虚拟机蓝屏问题的解决方案和虚拟机无法开机时的解决方法。
240 21
VMware Workstation常见的故障处理
|
2月前
|
虚拟化 网络虚拟化 网络架构
虚拟机 VMware Workstation 16 PRO 的网络配置
虚拟机 VMware Workstation 16 PRO 的网络配置
91 2
|
3月前
|
虚拟化
VMware Workstation子网划分及bond配置案例
本文主要介绍了如何在VMware Workstation中进行子网划分以及如何添加和配置四块网卡以实现bond模式,并通过配置文件和命令行操作来验证bond模式的有效性。
81 3
VMware Workstation子网划分及bond配置案例
|
3月前
|
虚拟化
VMware Workstation产品常用的快捷键
文章介绍了VMware Workstation产品中常用的快捷键及其功能,包括对虚拟机的控制、设置、快照管理等操作,同时提供了作者的联系方式和博客链接。
184 15
|
5月前
|
虚拟化
VMware Workstation 16 Pro安装教程
VMware Workstation 16 Pro安装教程
172 1
|
6月前
|
Linux 调度 虚拟化
Linux系统——初识Linux、虚拟机介绍、VMware WorkStation安装、在VMware上安装Linux
Linux系统——初识Linux、虚拟机介绍、VMware WorkStation安装、在VMware上安装Linux
136 4
|
5月前
|
Linux 虚拟化
部署04-ncpa.cpl 虚拟机介绍,什么是虚拟机,怎样使用虚拟机,安装VMWARE,WorkStation,VMWARE这款软件是收费软件,可以在一个月期间进行使用,成功看VMWARE高级网络设置
部署04-ncpa.cpl 虚拟机介绍,什么是虚拟机,怎样使用虚拟机,安装VMWARE,WorkStation,VMWARE这款软件是收费软件,可以在一个月期间进行使用,成功看VMWARE高级网络设置
|
7月前
|
存储 Linux 虚拟化
VMware保姆级安装教程-VMware Workstation Pro 16(Windows10)
VMware保姆级安装教程-VMware Workstation Pro 16(Windows10)
下一篇
DataWorks