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