openstack-pike安装heat

本文介绍如何在控制节点上安装Heat服务,包括创建数据库、用户、服务、API端口等步骤,并详细说明了配置文件的修改及服务启动过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在控制节点安装

1、首先进入数据库创建heat数据库,并且赋予权限

mysql -u root -p
CREATE DATABASE heat;
GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' \
  IDENTIFIED BY 'HEAT_DBPASS';
GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' \
  IDENTIFIED BY 'HEAT_DBPASS';

2、创建heat用户并且添加规则

 openstack user create --domain default --password-prompt heat
  openstack role add --project service --user heat admin

3、创建heat和heat-cfn服务

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

4、创建heat服务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\)s
 openstack 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、创建包含项目和用户的heat域

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

6、创建heat_domain_admin用户来管理heat域中的项目和用户,并且添加规则

openstack user create --domain heat --password-prompt heat_domain_admin
penstack role add --domain heat --user-domain heat --user heat_domain_admin admin

7、创建heat_stack_owner用户,并且添加规则

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

8、创建heat_stack_user规则

openstack role create heat_stack_user

9、安装heat软件包

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

10、修改配置文件/etc/heat/heat.conf

[database]
connection = mysql+pymysql://heat:HEAT_DBPASS@controller/heat
[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = heat
password = HEAT_PASS
[trustee]
auth_type = password
auth_url = http://controller:35357
username = heat
password = HEAT_PASS
user_domain_name = default
[clients_keystone]
auth_uri = http://controller:35357
[ec2authtoken]
auth_uri = http://controller:5000/v3
[DEFAULT]
heat_metadata_server_url = http://controller:8000
heat_waitcondition_server_url = http://controller:8000/v1/waitcondition
[DEFAULT]
stack_domain_admin = heat_domain_admin
stack_domain_admin_password = HEAT_DOMAIN_PASS
stack_user_domain_name = heat

11、同步数据看

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

12、启动heat服务并且设置开机自动启动

systemctl enable openstack-heat-api.service \
  openstack-heat-api-cfn.service openstack-heat-engine.service
systemctl start openstack-heat-api.service \
  openstack-heat-api-cfn.service openstack-heat-engine.service

13、验证

openstack orchestration service list
### 安装 OpenStack Nova 组件 可以通过 `yum` 命令来安装 OpenStack Nova 的相关组件,具体命令如下: ```bash yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-scheduler openstack-nova-novncproxy ``` 此命令将会自动下载安装所需的依赖项以及指定的服务组件[^1]。 --- ### 配置 OpenStack Nova 服务 完成安装后,需要对这些服务进行必要的配置。以下是主要步骤说明: #### 修改主配置文件 编辑 `/etc/nova/nova.conf` 文件以调整调度器的行为。例如,为了实现定期扫描计算节点的功能,可以在 `[scheduler]` 节下添加以下参数: ```ini [scheduler] discover_hosts_in_cells_interval = 300 ``` 这表示每隔 300 秒(即 5 分钟)扫描一次计算节点中的主机状态[^4]。 保存更改后重启 API 服务以使新配置生效: ```bash systemctl restart openstack-nova-api.service ``` --- ### 启动与设置开机自启 安装完成后,需手动启动各个 Nova 相关服务,将其设为随系统启动而运行: ```bash systemctl start openstack-nova-api openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy systemctl enable openstack-nova-api openstack-nova-scheduler openstack-nova-conductor openstack-nova-novncproxy ``` 以上操作确保了所有核心服务正常运行能够在下次系统启动时自动加载[^2]。 --- ### 创建管理接口端点 如果尚未创建 Nova 的管理员服务端点,则可通过以下命令完成初始化工作: ```bash openstack endpoint create --region RegionOne nova admin http://<control_node_ip>:8774/v2.1 ``` 其中 `<control_node_ip>` 应替换为实际的控制器节点 IP 地址。成功执行该命令后,将返回包含字段及其对应值的结果表单,确认端点已正确注册到 Keystone 中[^3]。 --- ### 总结 综上所述,通过 Yum 源安装 OpenStack Nova 组件的过程涉及以下几个方面: 1. 使用 `yum` 工具批量安装所需软件包; 2. 编辑配置文件优化功能选项; 3. 手动激活各子服务将它们加入系统的引导序列; 4. 注册相应的访问入口至身份验证框架内。 按照上述指导即可顺利完成基础环境搭建任务。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值