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

相关文章

Spring Security 基于表达式的权限控制

前言 spring security 3.0已经可以使用spring el表达式来控制授权,允许在表达式中使用复杂的布尔逻辑来控制访问的权限。 常见的表达式 Spring Security可用表达式对象的基类是SecurityExpressionRoot。 表达式描述hasRole([role])用户拥有制定的角色时返回true (Spring security默认会带有ROLE_前缀),去

Spring Security 从入门到进阶系列教程

Spring Security 入门系列 《保护 Web 应用的安全》 《Spring-Security-入门(一):登录与退出》 《Spring-Security-入门(二):基于数据库验证》 《Spring-Security-入门(三):密码加密》 《Spring-Security-入门(四):自定义-Filter》 《Spring-Security-入门(五):在 Sprin

JS常用组件收集

收集了一些平时遇到的前端比较优秀的组件,方便以后开发的时候查找!!! 函数工具: Lodash 页面固定: stickUp、jQuery.Pin 轮播: unslider、swiper 开关: switch 复选框: icheck 气泡: grumble 隐藏元素: Headroom

Zookeeper安装和配置说明

一、Zookeeper的搭建方式 Zookeeper安装方式有三种,单机模式和集群模式以及伪集群模式。 ■ 单机模式:Zookeeper只运行在一台服务器上,适合测试环境; ■ 伪集群模式:就是在一台物理机上运行多个Zookeeper 实例; ■ 集群模式:Zookeeper运行于一个集群上,适合生产环境,这个计算机集群被称为一个“集合体”(ensemble) Zookeeper通过复制来实现

CentOS7安装配置mysql5.7 tar免安装版

一、CentOS7.4系统自带mariadb # 查看系统自带的Mariadb[root@localhost~]# rpm -qa|grep mariadbmariadb-libs-5.5.44-2.el7.centos.x86_64# 卸载系统自带的Mariadb[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7

Centos7安装Mongodb4

1、下载源码包 curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.1.tgz 2、解压 放到 /usr/local/ 目录下 tar -zxvf mongodb-linux-x86_64-rhel70-4.2.1.tgzmv mongodb-linux-x86_64-rhel70-4.2.1/

【前端学习】AntV G6-08 深入图形与图形分组、自定义节点、节点动画(下)

【课程链接】 AntV G6:深入图形与图形分组、自定义节点、节点动画(下)_哔哩哔哩_bilibili 本章十吾老师讲解了一个复杂的自定义节点中,应该怎样去计算和绘制图形,如何给一个图形制作不间断的动画,以及在鼠标事件之后产生动画。(有点难,需要好好理解) <!DOCTYPE html><html><head><meta charset="UTF-8"><title>06

Centos7安装JDK1.8保姆版

工欲善其事,必先利其器。这句话同样适用于学习Java编程。在开始Java的学习旅程之前,我们必须首先配置好适合的开发环境。 通过事先准备好这些工具和配置,我们可以避免在学习过程中遇到因环境问题导致的代码异常或错误。一个稳定、高效的开发环境能够让我们更加专注于代码的学习和编写,提升学习效率,减少不必要的困扰和挫折感。因此,在学习Java之初,投入一些时间和精力来配置好开发环境是非常值得的。这将为我

如何在页面调用utility bar并传递参数至lwc组件

1.在app的utility item中添加lwc组件: 2.调用utility bar api的方式有两种: 方法一,通过lwc调用: import {LightningElement,api ,wire } from 'lwc';import { publish, MessageContext } from 'lightning/messageService';import Ca

科研绘图系列:R语言扩展物种堆积图(Extended Stacked Barplot)

介绍 R语言的扩展物种堆积图是一种数据可视化工具,它不仅展示了物种的堆积结果,还整合了不同样本分组之间的差异性分析结果。这种图形表示方法能够直观地比较不同物种在各个分组中的显著性差异,为研究者提供了一种有效的数据解读方式。 加载R包 knitr::opts_chunk$set(warning = F, message = F)library(tidyverse)library(phyl