当前位置:   article > 正文

解读先电2.4 iaas-install-heat.sh 脚本

iaas-install-heat.sh
#!/bin/bash
source /etc/xiandian/openrc.sh
source /etc/keystone/admin-openrc.sh

mysql -uroot -p$DB_PASS -e "create database IF NOT EXISTS heat ;"
mysql -uroot -p$DB_PASS -e "GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'localhost' IDENTIFIED BY '$HEAT_DBPASS' ;"
mysql -uroot -p$DB_PASS -e "GRANT ALL PRIVILEGES ON heat.* TO 'heat'@'%' IDENTIFIED BY '$HEAT_DBPASS' ;"

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

openstack user create --domain $DOMAIN_NAME --password $HEAT_PASS heat
openstack role add --project service --user heat admin
openstack service create --name heat --description "Orchestration" orchestration
openstack service create --name heat-cfn --description "Orchestration"  cloudformation 

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

openstack domain create --description "Stack projects and users" heat   		 #创建heat域,用来管理堆栈项目和用户
openstack user create --domain heat  --password $HEAT_PASS heat_domain_admin
openstack role add --domain heat --user-domain heat --user heat_domain_admin admin
openstack role create heat_stack_owner
openstack role add --project demo --user demo heat_stack_owner
openstack role create heat_stack_user
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
crudini --set /etc/heat/heat.conf database connection mysql+pymysql://heat:$HEAT_DBPASS@$HOST_NAME/heat

crudini --set /etc/heat/heat.conf DEFAULT transport_url rabbit://$RABBIT_USER:$RABBIT_PASS@$HOST_NAME

#配置keystone认证服务
crudini --set /etc/heat/heat.conf keystone_authtoken auth_uri  http://$HOST_NAME:5000
crudini --set /etc/heat/heat.conf keystone_authtoken auth_url  http://$HOST_NAME:35357
crudini --set /etc/heat/heat.conf keystone_authtoken memcached_servers  $HOST_NAME:11211
crudini --set /etc/heat/heat.conf keystone_authtoken auth_type  password
crudini --set /etc/heat/heat.conf keystone_authtoken project_domain_name  $DOMAIN_NAME
crudini --set /etc/heat/heat.conf keystone_authtoken user_domain_name $DOMAIN_NAME
crudini --set /etc/heat/heat.conf keystone_authtoken project_name  service
crudini --set /etc/heat/heat.conf keystone_authtoken username  heat
crudini --set /etc/heat/heat.conf keystone_authtoken password  $HEAT_PASS

#配置受托
crudini --set /etc/heat/heat.conf trustee auth_plugin password
crudini --set /etc/heat/heat.conf trustee auth_url http://$HOST_NAME:35357
crudini --set /etc/heat/heat.conf trustee username heat
crudini --set /etc/heat/heat.conf trustee password $HEAT_PASS
crudini --set /etc/heat/heat.conf trustee user_domain_name $DOMAIN_NAME
crudini --set /etc/heat/heat.conf clients_keystone auth_uri http://$HOST_NAME:35357

#配置元数据和URL
crudini --set /etc/heat/heat.conf DEFAULT heat_metadata_server_url http://$HOST_NAME:8000
crudini --set /etc/heat/heat.conf DEFAULT heat_waitcondition_server_url http://$HOST_NAME:8000/v1/waitcondition

#配置关于heat认证实体服务的域
crudini --set /etc/heat/heat.conf DEFAULT stack_domain_admin heat_domain_admin
crudini --set /etc/heat/heat.conf DEFAULT stack_domain_admin_password $HEAT_PASS
crudini --set /etc/heat/heat.conf DEFAULT stack_user_domain_name heat

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

systemctl enable openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service
systemctl restart openstack-heat-api.service openstack-heat-api-cfn.service openstack-heat-engine.service
systemctl restart httpd memcached
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

——heat-api:实现 OpenStack 原生支持的 REST API。该组件通过把 API 请求经由 AMQP 传送给 Heat engine 来处理 API 请求。

——heat-api-cfn:提供与 AWS CloudFormation 兼容的、AWS 风格的查询 API,处理请求并通过 AMQP 将它们发送到 heat-engine。

——heat-engine:执行模板内容,最终完成应用系统的创建和部署,并把执行结果返回给 API 调用者。

OpenStack中heat组件详解:https://www.cnblogs.com/mh20131118/p/12963885.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/70612
推荐阅读
相关标签
  

闽ICP备14008679号