9、执行相关服务部署脚本
【controller| compute】
# iaas-pre-host.sh # reboot
等到controller、compute两个节点同时创建完成后再同时重启centos
Please Reboot or Reconnect the terminal
当同时在两个节点看到此提示,即可重启。
【controller】
安装数据库服务
[root@controller ~]# iaas-install-mysql.sh
安装认证服务
[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
验证计算服务
[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
【controller】
安装网络服务
[root@controller ~]# iaas-install-neutron-controller.sh
【compute】
安装网络服务
[root@compute ~]# iaas-install-neutron-compute.sh
【controller】
安装Dashboard服务
[root@controller ~]# iaas-install-dashboard.sh
10、登录Dashboard管理控制平台
至此。基础部分搭建完成!
11、可选服务补充搭建
安装块存储服务
【controller】
[root@controller ~]# iaas-install-cinder-controller.sh
安装对象存储服务
[root@controller ~]# iaas-install-swift-controller.sh
【compute】
安装块存储服务
[root@compute ~]# iaas-install-cinder-compute.sh
安装对象存储服务
[root@compute ~]# iaas-install-swift-compute.sh
注意是否从控制节点中传送过来以下三个压缩包
account.ring.gz 100% 728 344.4KB/s 00:00 container.ring.gz 100% 207 121.1KB/s 00:00 object.ring.gz 100% 204 277.6KB/s 00:00
【controller】
安装编排服务
[root@controller ~]# iaas-install-heat.sh
【controller】
安装zun服务
[root@controller ~]# iaas-install-zun-controller.sh
【compute】
安装zun服务
[root@compute ~]# iaas-install-zun-compute.sh
【controller】
上传容器镜像
[root@controller ~]# source /etc/keystone/admin-openrc.sh [root@controller ~]# cd /opt/openstack/images/ [root@controller images]# ls CentOS_6.5_x86_64_XD.qcow2 CentOS7_1804.tar CentOS_7.2_x86_64_XD.qcow2 CentOS_7.5_x86_64_XD.qcow2 [root@controller images]# openstack image create centos-zun-7.5 --public --container-format docker --disk-format raw < CentOS7_1804.tar +------------------+------------------------------------------------------+ | Field | Value | +------------------+------------------------------------------------------+ | checksum | 438e76cdb677a3ab1156e284f58aa366 | | container_format | docker | | created_at | 2020-11-15T05:49:51Z | | disk_format | raw | | file | /v2/images/0b93bcf3-0acf-4908-89f3-e0cca9e366e1/file | | id | 0b93bcf3-0acf-4908-89f3-e0cca9e366e1 | | min_disk | 0 | | min_ram | 0 | | name | centos-zun-7.5 | | owner | b80d6a7fd05641aea59268fc30775ed5 | | protected | False | | schema | /v2/schemas/image | | size | 381696512 | | status | active | | tags | | | updated_at | 2020-11-15T05:49:53Z | | virtual_size | None | | visibility | public | +------------------+------------------------------------------------------+ [root@controller images]# openstack image list +--------------------------------------+----------------+--------+ | ID | Name | Status | +--------------------------------------+----------------+--------+ | 0b93bcf3-0acf-4908-89f3-e0cca9e366e1 | centos-zun-7.5 | active | | 1fea3777-e5ed-46b7-9dae-2d9a3554bb99 | cirros | active | +--------------------------------------+----------------+--------+
启动容器
[root@controller images]# zun run --image-driver glance centos-zun-7.5 +-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Property | Value | +-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | addresses | | | links | ["{u'href': u'http://controller:9517/v1/containers/dfd250a4-f70e-49dc-ae56-fcbe17df8e6c', u'rel': u'self'}", "{u'href': u'http://controller:9517/containers/dfd250a4-f70e-49dc-ae56-fcbe17df8e6c', u'rel': u'bookmark'}"] | | image | centos-zun-7.5 | | labels | {} | | disk | 0 | | networks | | | security_groups | None | | image_pull_policy | None | | user_id | cac753e558c747338116623b8de8de42 | | uuid | dfd250a4-f70e-49dc-ae56-fcbe17df8e6c | | hostname | None | | environment | {} | | memory | None | | project_id | b80d6a7fd05641aea59268fc30775ed5 | | status | Creating | | workdir | None | | auto_remove | False | | status_detail | None | | host | None | | image_driver | glance | | task_state | None | | status_reason | None | | name | delta-2-container | | restart_policy | None | | ports | None | | command | None | | runtime | None | | cpu | None | | interactive | False | +-------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
查询容器
[root@controller images]# zun list +--------------------------------------+-------------------+----------------+---------+------------+-----------+-------+ | uuid | name | image | status | task_state | addresses | ports | +--------------------------------------+-------------------+----------------+---------+------------+-----------+-------+ | dfd250a4-f70e-49dc-ae56-fcbe17df8e6c | delta-2-container | centos-zun-7.5 | Running | None | 10.0.0.3 | [22] | +--------------------------------------+-------------------+----------------+---------+------------+-----------+-------+
登录容器
[C:\~]$ ssh 10.0.0.3 Connecting to 10.0.0.3:22... Connection established. To escape to local shell, press Ctrl+Alt+]. WARNING! The remote SSH server rejected X11 forwarding request. [root@ce707216eaa8 ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 8: eth0@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether fa:16:3e:49:c4:af brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.0.0.3/24 brd 10.0.0.255 scope global eth0 valid_lft forever preferred_lft forever [root@ce707216eaa8 ~]#
【controller】
安装Ceilometer监控服务
[root@controller ~]# iaas-install-ceilometer-controller.sh
【compute】
安装Ceilometer监控服务
[root@compute ~]# iaas-install-ceilometer-compute.sh
【controller】
[root@controller ~]# iaas-install-aodh.sh
【controller】
添加控制节点的计算服务资源
修改openrc.sh的配置文件
[root@controller ~]# vi /etc/xiandian/openrc.sh
修改计算节点的主机名和IP地址为控制节点的主机名和IP地址
[root@controller ~]# iaas-install-nova-compute.sh