OpenStack离线Train版安装系列—10.控制节点-Heat服务组件

2024-09-08 10:48

本文主要是介绍OpenStack离线Train版安装系列—10.控制节点-Heat服务组件,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本系列文章包含从OpenStack离线源制作到完成OpenStack安装的全部过程。
在本系列教程中使用的OpenStack的安装版本为第20个版本Train(简称T版本),2020年5月13日,OpenStack社区发布了第21个版本Ussuri(简称U版本)。

OpenStack部署系列文章
OpenStack Victoria版 安装部署系列教程
OpenStack Ussuri版 离线安装部署系列教程(全)
OpenStack Train版 离线安装部署系列教程(全)
欢迎留言沟通,共同进步。


文章目录

  • OpenStack离线Train版安装系列—10.控制节点-Heat服务组件
    • 一、创建heat相关数据库、服务凭证和API端点
      • 1.创建heat数据库,并授予合适的访问权限
      • 2.获得 admin 凭证来获取只有管理员能执行的命令的访问权限
      • 3.创建服务证书
      • 4.创建 Orchestration 服务的 API 端点
      • 5.为了管理栈,在认证服务中Orchestration需要更多信息
    • 二、安装并配置Heat组件相关软件
      • 1.安装软件包
      • 2.修改heat配置
      • 3.同步Orchestration数据库
    • 三、启动 Orchestration 编排服务heat组件并将其设置为随系统启动
    • 四、验证操作
      • 1.获得 admin 凭证来获取只有管理员能执行的命令的访问权限
      • 2.列出服务组件,以验证是否成功启动并注册了每个进程:
      • 3.PS查看进程
    • 五、启动一个实例


OpenStack离线Train版安装系列—10.控制节点-Heat服务组件

在控制节点安装Heat编排服务

官方参考:
https://docs.openstack.org/install-guide/openstack-services.html
https://docs.openstack.org/train/install/
https://docs.openstack.org/heat/train/
https://docs.openstack.org/heat/train/install/
https://docs.openstack.org/heat/train/install/install-rdo.html
https://docs.openstack.org/heat/train/install/verify.html
https://docs.openstack.org/heat/train/install/launch-instance.html
https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/
https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/common/get_started_orchestration.html

一、创建heat相关数据库、服务凭证和API端点

https://docs.openstack.org/heat/train/install/install-rdo.html

1.创建heat数据库,并授予合适的访问权限

#用数据库连接客户端以 root 用户连接到数据库服务器:
mysql -u root -proot#创建 heat 数据库:
MariaDB [(none)]> CREATE DATABASE heat;#对``heat``数据库授予恰当的权限:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' \IDENTIFIED BY 'HEAT_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' \IDENTIFIED BY 'HEAT_DBPASS';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> show databases;
MariaDB [(none)]> select user,host from mysql.user;#退出数据库客户端。
MariaDB [(none)]> exit

请自行设置HEAT_DBPASS为合适的密码。

2.获得 admin 凭证来获取只有管理员能执行的命令的访问权限

cd
source admin-openrc.sh

3.创建服务证书

(1)创建heat 用户:

openstack user create --domain default --password=HEAT_USER_PASS heat

or

openstack user create --domain default --password-prompt heat

(2)添加 admin 角色到 heat 用户上

openstack role add --project service --user heat admin
#This command provides no output.

这个命令执行后没有输出。

(3)创建heat和 heat-cfn 服务实体

openstack service create --name heat \--description "Orchestration" orchestration
openstack service create --name heat-cfn \--description "Orchestration"  cloudformation  

4.创建 Orchestration 服务的 API 端点

openstack endpoint create --region RegionOne \orchestration public http://controller:8004/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \orchestration internal http://controller:8004/v1/%\(tenant_id\)s
openstack endpoint create --region RegionOne \orchestration admin http://controller:8004/v1/%\(tenant_id\)sopenstack endpoint create --region RegionOne \cloudformation public http://controller:8000/v1
openstack endpoint create --region RegionOne \cloudformation internal http://controller:8000/v1
openstack endpoint create --region RegionOne \cloudformation admin http://controller:8000/v1

5.为了管理栈,在认证服务中Orchestration需要更多信息

(1)为栈创建 heat 包含项目和用户的域

openstack domain create --description "Stack projects and users" heat

(2)在 heat 域中创建管理项目和用户的heat_domain_admin用户:

openstack user create --domain heat --password=HEAT_DOMAIN_USER_PASS heat_domain_admin

or

openstack user create --domain heat --password-prompt heat_domain_admin

(3)添加admin角色到 heat 域 中的heat_domain_admin用户,启用heat_domain_admin用户管理栈的管理权限

openstack role add --domain heat --user-domain heat --user heat_domain_admin admin

这个命令执行后没有输出。

(4)创建 heat_stack_owner 角色:

openstack role create heat_stack_owner

(5)添加heat_stack_owner 角色到demo 项目和用户,启用demo 用户管理栈。

openstack role add --project demo --user demo heat_stack_owner

这个命令执行后没有输出。
必须添加 heat_stack_owner 角色到每个管理栈的用户。

(6)创建 heat_stack_user 角色

openstack role create heat_stack_user

二、安装并配置Heat组件相关软件

1.安装软件包

yum install openstack-heat-api openstack-heat-api-cfn \openstack-heat-engine -y

2.修改heat配置

/etc/heat/heat.conf

(1)详细配置

在 [database] 部分,配置数据库访问:

[database]
...
connection = mysql+pymysql://heat:HEAT_DBPASS@controller/heat

将 HEAT_DBPASS 替换为 之前设置heat数据库步骤中的Orchestration 数据库密码。

在 [DEFAULT]部分,配置 “RabbitMQ” 消息队列访问:

[DEFAULT]
...
transport_url = rabbit://openstack:RABBIT_USER_PASS@controller

用你在 “RabbitMQ” 中为 “openstack” 用户选择的密码替换 “RABBIT_USER_PASS”。

在[keystone_authtoken], [trustee],[clients_keystone] 部分,配置认证服务访问

[keystone_authtoken]
...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = heat
password = HEAT_USER_PASS[trustee]
...
auth_type = password
auth_url = http://controller:5000
username = heat
password = HEAT_USER_PASS
user_domain_name = default[clients_keystone]
...
auth_uri = http://controller:5000

HEAT_PASS 替换为在认证服务中为 heat 用户选择的密码

[DEFAULT] 部分,配置元数据和 等待条件URLs:

[DEFAULT]
...
heat_metadata_server_url = http://controller:8000
heat_waitcondition_server_url = http://controller:8000/v1/waitcondition

在 [DEFAULT] 部分,配置栈域与管理凭据:

[DEFAULT]
...
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = HEAT_DOMAIN_USER_PASS
stack_user_domain_name = heat

3.同步Orchestration数据库

su -s /bin/sh -c "heat-manage db_sync" heat

忽略输出中任何不推荐使用的信息。

三、启动 Orchestration 编排服务heat组件并将其设置为随系统启动

systemctl enable openstack-heat-api.service \openstack-heat-api-cfn.service openstack-heat-engine.servicesystemctl restart openstack-heat-api.service \openstack-heat-api-cfn.service openstack-heat-engine.servicesystemctl list-unit-files |grep openstack-heat*

四、验证操作

https://docs.openstack.org/heat/train/install/verify.html

1.获得 admin 凭证来获取只有管理员能执行的命令的访问权限

[root@controller ~]# cd
[root@controller ~]# source admin-openrc.sh

2.列出服务组件,以验证是否成功启动并注册了每个进程:

[root@controller ~]# openstack service list
+----------------------------------+-----------+----------------+
| ID                               | Name      | Type           |
+----------------------------------+-----------+----------------+
| 1ebdb5b3fe424b6cbecfc7f8531e01f7 | neutron   | network        |
| 4cc7d70db6eb4af58b0c81579f272e81 | heat      | orchestration  |
| 93ad2a6a475b434da264ae730761279c | placement | placement      |
| be75e5a33bd94739a71998d5f90a6cdc | keystone  | identity       |
| c73205af0de142b8b9481adf0d52a110 | cinderv3  | volumev3       |
| cce9ddafb0ce4114aef077d9d960cdf5 | glance    | image          |
| e2347aa92b0443539cd53c8b08650b68 | nova      | compute        |
| e601c6afb77f4153b0e37c7a2a3f10df | heat-cfn  | cloudformation |
| f4b15cb55246411ca5c15e7dee1c0326 | cinderv2  | volumev2       |
+----------------------------------+-----------+----------------+
[root@controller ~]# 
[root@controller ~]# openstack orchestration service list
+------------+-------------+--------------------------------------+------------+--------+----------------------------+--------+
| hostname   | binary      | engine_id                            | host       | topic  | updated_at                 | status |
+------------+-------------+--------------------------------------+------------+--------+----------------------------+--------+
| controller | heat-engine | 3e85d1ab-a543-41aa-aa97-378c381fb958 | controller | engine | 2015-10-13T14:16:06.000000 | up     |
| controller | heat-engine | 45dbdcf6-5660-4d5f-973a-c4fc819da678 | controller | engine | 2015-10-13T14:16:06.000000 | up     |
| controller | heat-engine | 51162b63-ecb8-4c6c-98c6-993af899c4f7 | controller | engine | 2015-10-13T14:16:06.000000 | up     |
| controller | heat-engine | 8d7edc6d-77a6-460d-bd2a-984d76954646 | controller | engine | 2015-10-13T14:16:06.000000 | up     |
+------------+-------------+--------------------------------------+------------+--------+----------------------------+--------+

该输出显示表明在控制节点上有应该四个heat-engine组件。

3.PS查看进程

依次使用以下命令

ps aux | grep heat
ps -A | grep heat
netstat -ltunp | grep 8000
netstat -ltunp | grep 8004

具体过程如下

[root@controller ~]# ps aux | grep heat
heat       5414  0.0  0.1 403852  2296 ?        Ss   12:11   0:01 /usr/bin/python2 /usr/bin/heat-api-cfn --config-file /usr/share/hea 
/heat-dist.conf --config-file /etc/heat/heat.conf
heat       5417  0.0  0.1 404740  3068 ?        Ss   12:11   0:01 /usr/bin/python2 /usr/bin/heat-api --config-file /usr/share/heat/heat-dist.conf --config-file /etc/heat/heat.conf
heat       5424  1.2  0.2 439952  3860 ?        Ss   12:11   1:41 /usr/bin/python2 /usr/bin/heat-engine --config-file /usr/share/heat 
heat-dist.conf --config-file /etc/heat/heat.conf
heat       5449  0.0  0.9 412964 16976 ?        S    12:12   0:05 /usr/bin/python2 /usr/bin/heat-api --config-file /usr/share/heat/heat-dist.conf --config-file /etc/heat/heat.conf
heat       5450  0.0  1.0 447288 19616 ?        S    12:12   0:04 /usr/bin/python2 /usr/bin/heat-engine --config-file /usr/share/heat 
heat-dist.conf --config-file /etc/heat/heat.conf
heat       5451  0.0  1.0 447288 19620 ?        S    12:12   0:03 /usr/bin/python2 /usr/bin/heat-engine --config-file /usr/share/heat 
heat-dist.conf --config-file /etc/heat/heat.conf
heat       5452  0.0  1.0 447288 19620 ?        S    12:12   0:04 /usr/bin/python2 /usr/bin/heat-engine --config-file /usr/share/heat 
heat-dist.conf --config-file /etc/heat/heat.conf
heat       5453  0.0  1.0 447288 19620 ?        S    12:12   0:04 /usr/bin/python2 /usr/bin/heat-engine --config-file /usr/share/heat 
heat-dist.conf --config-file /etc/heat/heat.conf
root      16112  0.0  0.0 112684   696 pts/0    R+   14:29   0:00 grep --color=auto heat
[root@controller ~]#  ps -A | grep heat5414 ?        00:00:01 heat-api-cfn5417 ?        00:00:01 heat-api5424 ?        00:01:41 heat-engine5449 ?        00:00:05 heat-api5450 ?        00:00:04 heat-engine5451 ?        00:00:03 heat-engine5452 ?        00:00:04 heat-engine5453 ?        00:00:04 heat-engine
[root@controller ~]# netstat -ltunp | grep 8000
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      5414/python2
[root@controller ~]# netstat -ltunp | grep 8004
tcp        0      0 0.0.0.0:8004            0.0.0.0:*               LISTEN      5417/python2
[root@controller ~]#

五、启动一个实例

官方文档
https://docs.openstack.org/heat/train/install/launch-instance.html
https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/launch-instance.html#launch-instance

这篇关于OpenStack离线Train版安装系列—10.控制节点-Heat服务组件的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1147904

相关文章

如何在Mac上安装并配置JDK环境变量详细步骤

《如何在Mac上安装并配置JDK环境变量详细步骤》:本文主要介绍如何在Mac上安装并配置JDK环境变量详细步骤,包括下载JDK、安装JDK、配置环境变量、验证JDK配置以及可选地设置PowerSh... 目录步骤 1:下载JDK步骤 2:安装JDK步骤 3:配置环境变量1. 编辑~/.zshrc(对于zsh

如何在pycharm安装torch包

《如何在pycharm安装torch包》:本文主要介绍如何在pycharm安装torch包方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录在pycharm安装torch包适http://www.chinasem.cn配于我电脑的指令为适用的torch包为总结在p

在PyCharm中安装PyTorch、torchvision和OpenCV详解

《在PyCharm中安装PyTorch、torchvision和OpenCV详解》:本文主要介绍在PyCharm中安装PyTorch、torchvision和OpenCV方式,具有很好的参考价值,... 目录PyCharm安装PyTorch、torchvision和OpenCV安装python安装PyTor

Python Transformer 库安装配置及使用方法

《PythonTransformer库安装配置及使用方法》HuggingFaceTransformers是自然语言处理(NLP)领域最流行的开源库之一,支持基于Transformer架构的预训练模... 目录python 中的 Transformer 库及使用方法一、库的概述二、安装与配置三、基础使用:Pi

使用Node.js制作图片上传服务的详细教程

《使用Node.js制作图片上传服务的详细教程》在现代Web应用开发中,图片上传是一项常见且重要的功能,借助Node.js强大的生态系统,我们可以轻松搭建高效的图片上传服务,本文将深入探讨如何使用No... 目录准备工作搭建 Express 服务器配置 multer 进行图片上传处理图片上传请求完整代码示例

Spring LDAP目录服务的使用示例

《SpringLDAP目录服务的使用示例》本文主要介绍了SpringLDAP目录服务的使用示例... 目录引言一、Spring LDAP基础二、LdapTemplate详解三、LDAP对象映射四、基本LDAP操作4.1 查询操作4.2 添加操作4.3 修改操作4.4 删除操作五、认证与授权六、高级特性与最佳

SpringQuartz定时任务核心组件JobDetail与Trigger配置

《SpringQuartz定时任务核心组件JobDetail与Trigger配置》Spring框架与Quartz调度器的集成提供了强大而灵活的定时任务解决方案,本文主要介绍了SpringQuartz定... 目录引言一、Spring Quartz基础架构1.1 核心组件概述1.2 Spring集成优势二、J

如何解决mmcv无法安装或安装之后报错问题

《如何解决mmcv无法安装或安装之后报错问题》:本文主要介绍如何解决mmcv无法安装或安装之后报错问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录mmcv无法安装或安装之后报错问题1.当我们运行YOwww.chinasem.cnLO时遇到2.找到下图所示这里3.

Python 安装和配置flask, flask_cors的图文教程

《Python安装和配置flask,flask_cors的图文教程》:本文主要介绍Python安装和配置flask,flask_cors的图文教程,本文通过图文并茂的形式给大家介绍的非常详细,... 目录一.python安装:二,配置环境变量,三:检查Python安装和环境变量,四:安装flask和flas

Win11安装PostgreSQL数据库的两种方式详细步骤

《Win11安装PostgreSQL数据库的两种方式详细步骤》PostgreSQL是备受业界青睐的关系型数据库,尤其是在地理空间和移动领域,:本文主要介绍Win11安装PostgreSQL数据库的... 目录一、exe文件安装 (推荐)下载安装包1. 选择操作系统2. 跳转到EDB(PostgreSQL 的