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

相关文章

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根

SpringBoot服务获取Pod当前IP的两种方案

《SpringBoot服务获取Pod当前IP的两种方案》在Kubernetes集群中,SpringBoot服务获取Pod当前IP的方案主要有两种,通过环境变量注入或通过Java代码动态获取网络接口IP... 目录方案一:通过 Kubernetes Downward API 注入环境变量原理步骤方案二:通过

Java SWT库详解与安装指南(最新推荐)

《JavaSWT库详解与安装指南(最新推荐)》:本文主要介绍JavaSWT库详解与安装指南,在本章中,我们介绍了如何下载、安装SWTJAR包,并详述了在Eclipse以及命令行环境中配置Java... 目录1. Java SWT类库概述2. SWT与AWT和Swing的区别2.1 历史背景与设计理念2.1.

安装centos8设置基础软件仓库时出错的解决方案

《安装centos8设置基础软件仓库时出错的解决方案》:本文主要介绍安装centos8设置基础软件仓库时出错的解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录安装Centos8设置基础软件仓库时出错版本 8版本 8.2.200android4版本 javas

Python远程控制MySQL的完整指南

《Python远程控制MySQL的完整指南》MySQL是最流行的关系型数据库之一,Python通过多种方式可以与MySQL进行交互,下面小编就为大家详细介绍一下Python操作MySQL的常用方法和最... 目录1. 准备工作2. 连接mysql数据库使用mysql-connector使用PyMySQL3.

Spring组件实例化扩展点之InstantiationAwareBeanPostProcessor使用场景解析

《Spring组件实例化扩展点之InstantiationAwareBeanPostProcessor使用场景解析》InstantiationAwareBeanPostProcessor是Spring... 目录一、什么是InstantiationAwareBeanPostProcessor?二、核心方法解

如何搭建并配置HTTPD文件服务及访问权限控制

《如何搭建并配置HTTPD文件服务及访问权限控制》:本文主要介绍如何搭建并配置HTTPD文件服务及访问权限控制的问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、安装HTTPD服务二、HTTPD服务目录结构三、配置修改四、服务启动五、基于用户访问权限控制六、

Pytorch介绍与安装过程

《Pytorch介绍与安装过程》PyTorch因其直观的设计、卓越的灵活性以及强大的动态计算图功能,迅速在学术界和工业界获得了广泛认可,成为当前深度学习研究和开发的主流工具之一,本文给大家介绍Pyto... 目录1、Pytorch介绍1.1、核心理念1.2、核心组件与功能1.3、适用场景与优势总结1.4、优

conda安装GPU版pytorch默认却是cpu版本

《conda安装GPU版pytorch默认却是cpu版本》本文主要介绍了遇到Conda安装PyTorchGPU版本却默认安装CPU的问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的... 目录一、问题描述二、网上解决方案罗列【此节为反面方案罗列!!!】三、发现的根本原因[独家]3.1 p

windows系统上如何进行maven安装和配置方式

《windows系统上如何进行maven安装和配置方式》:本文主要介绍windows系统上如何进行maven安装和配置方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不... 目录1. Maven 简介2. maven的下载与安装2.1 下载 Maven2.2 Maven安装2.