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

相关文章

Vue中组件之间传值的六种方式(完整版)

《Vue中组件之间传值的六种方式(完整版)》组件是vue.js最强大的功能之一,而组件实例的作用域是相互独立的,这就意味着不同组件之间的数据无法相互引用,针对不同的使用场景,如何选择行之有效的通信方式... 目录前言方法一、props/$emit1.父组件向子组件传值2.子组件向父组件传值(通过事件形式)方

Linux安装MySQL的教程

《Linux安装MySQL的教程》:本文主要介绍Linux安装MySQL的教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux安装mysql1.Mysql官网2.我的存放路径3.解压mysql文件到当前目录4.重命名一下5.创建mysql用户组和用户并修

Linux上设置Ollama服务配置(常用环境变量)

《Linux上设置Ollama服务配置(常用环境变量)》本文主要介绍了Linux上设置Ollama服务配置(常用环境变量),Ollama提供了多种环境变量供配置,如调试模式、模型目录等,下面就来介绍一... 目录在 linux 上设置环境变量配置 OllamPOgxSRJfa手动安装安装特定版本查看日志在

pip无法安装osgeo失败的问题解决

《pip无法安装osgeo失败的问题解决》本文主要介绍了pip无法安装osgeo失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 进入官方提供的扩展包下载网站寻找版本适配的whl文件注意:要选择cp(python版本)和你py

SpringCloud之LoadBalancer负载均衡服务调用过程

《SpringCloud之LoadBalancer负载均衡服务调用过程》:本文主要介绍SpringCloud之LoadBalancer负载均衡服务调用过程,具有很好的参考价值,希望对大家有所帮助,... 目录前言一、LoadBalancer是什么?二、使用步骤1、启动consul2、客户端加入依赖3、以服务

Python异步编程中asyncio.gather的并发控制详解

《Python异步编程中asyncio.gather的并发控制详解》在Python异步编程生态中,asyncio.gather是并发任务调度的核心工具,本文将通过实际场景和代码示例,展示如何结合信号量... 目录一、asyncio.gather的原始行为解析二、信号量控制法:给并发装上"节流阀"三、进阶控制

使用DrissionPage控制360浏览器的完美解决方案

《使用DrissionPage控制360浏览器的完美解决方案》在网页自动化领域,经常遇到需要保持登录状态、保留Cookie等场景,今天要分享的方案可以完美解决这个问题:使用DrissionPage直接... 目录完整代码引言为什么要使用已有用户数据?核心代码实现1. 导入必要模块2. 关键配置(重点!)3.

Android App安装列表获取方法(实践方案)

《AndroidApp安装列表获取方法(实践方案)》文章介绍了Android11及以上版本获取应用列表的方案调整,包括权限配置、白名单配置和action配置三种方式,并提供了相应的Java和Kotl... 目录前言实现方案         方案概述一、 androidManifest 三种配置方式

SpringSecurity 认证、注销、权限控制功能(注销、记住密码、自定义登入页)

《SpringSecurity认证、注销、权限控制功能(注销、记住密码、自定义登入页)》SpringSecurity是一个强大的Java框架,用于保护应用程序的安全性,它提供了一套全面的安全解决方案... 目录简介认识Spring Security“认证”(Authentication)“授权” (Auth

Python解析器安装指南分享(Mac/Windows/Linux)

《Python解析器安装指南分享(Mac/Windows/Linux)》:本文主要介绍Python解析器安装指南(Mac/Windows/Linux),具有很好的参考价值,希望对大家有所帮助,如有... 目NMNkN录1js. 安装包下载1.1 python 下载官网2.核心安装方式3. MACOS 系统安