此内容没有您所选择的语言版本。
9.2. Configure the Orchestration Service
To configure the Orchestration service, you must complete the following tasks:
- Configure a database for the Orchestration service.
- Bind each Orchestration API service to a corresponding IP address.
- Create and configure the Orchestration service Identity records.
- Configure how Orchestration services authenticate with the Identity service.
The following sections describe each procedure in detail.
9.2.1. Create the Orchestration Service Database 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Create the database and database user used by the Orchestration service. The database connection string used by the Orchestration service is defined in the
/etc/heat/heat.conf file. It must be updated to point to a valid database server before the service is started. All steps in this procedure must be performed on the database server, while logged in as the root user.
Procedure 9.1. Configuring the Orchestration Service Database
- Connect to the database service:
mysql -u root -p
# mysql -u root -pCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
heatdatabase:mysql> CREATE DATABASE heat;
mysql> CREATE DATABASE heat;Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create a database user named
heatand grant the user access to theheatdatabase:mysql> GRANT ALL ON heat.* TO 'heat'@'%' IDENTIFIED BY 'PASSWORD'; mysql> GRANT ALL ON heat.* TO 'heat'@'localhost' IDENTIFIED BY 'PASSWORD';
mysql> GRANT ALL ON heat.* TO 'heat'@'%' IDENTIFIED BY 'PASSWORD'; mysql> GRANT ALL ON heat.* TO 'heat'@'localhost' IDENTIFIED BY 'PASSWORD';Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with a secure password that will be user to authenticate with the database server as this user. - Flush the database privileges to ensure that they take effect immediately:
mysql> FLUSH PRIVILEGES;
mysql> FLUSH PRIVILEGES;Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Exit the mysql client:
mysql> quit
mysql> quitCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the value of the
sql_connectionconfiguration key:openstack-config --set /etc/heat/heat.conf \ DEFAULT sql_connection mysql://heat:PASSWORD@IP/heat
# openstack-config --set /etc/heat/heat.conf \ DEFAULT sql_connection mysql://heat:PASSWORD@IP/heatCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace PASSWORD with the password of the
heatdatabase user. - Replace IP with the IP address or host name of the database server.
- As the
heatuser, sync the database:runuser -s /bin/sh heat -c "heat-manage db_sync"
# runuser -s /bin/sh heat -c "heat-manage db_sync"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Important
The IP address or host name specified in the connection configuration key must match the IP address or host name to which the Orchestration service database user was granted access when creating the Orchestration service database. Moreover, if the database is hosted locally and you granted permissions to 'localhost' when creating the Orchestration service database, you must enter 'localhost'.
After configuring the database, set the
bind_host setting of each Orchestration API service. This setting controls which IP address a service should use for incoming connections.
Set the
bind_host setting for each Orchestration API service:
Replace IP with the IP address that the corresponding API should use.
9.2.3. Create the Orchestration Service Identity Records 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Create and configure Identity service records required by the Orchestration service. These entries assist other OpenStack services attempting to locate and access the functionality provided by the Orchestration service.
This procedure assumes that you have already created an administrative user account and a
services tenant. For more information, see:
Perform this procedure on the Identity service server, or on any machine onto which you have copied the
keystonerc_admin file and on which the keystone command-line utility is installed.
Procedure 9.2. Creating Identity Records for the Orchestration Service
- Set up the shell to access Keystone as the administrative user:
source ~/keystonerc_admin
# source ~/keystonerc_adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
heatuser:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with a password that will be used by the Orchestration service when authenticating with the Identity service. - Link the
heatuser and theadminrole together within the context of theservicestenant:[(keystone_admin)]# keystone user-role-add --user heat --role admin --tenant services
[(keystone_admin)]# keystone user-role-add --user heat --role admin --tenant servicesCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the
heatandheat-cfnservice entries:[(keystone_admin)]# keystone service-create --name heat \ --type orchestration # keystone service-create --name heat-cfn \ --type cloudformation
[(keystone_admin)]# keystone service-create --name heat \ --type orchestration # keystone service-create --name heat-cfn \ --type cloudformationCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Create endpoint entries for the
heatservice and theheat-cfnservice:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace HEAT_CFN_IP with the IP or host name of the system hosting the
heat-cfnservice. - Replace HEAT_IP with the IP or host name of the system hosting the
heatservice.
Important
Include thehttp://prefix for HEAT_CFN_IP and HEAT_IP values.
The Orchestration service requires its own Identity domain, through which users can be created and associated with credentials deployed inside instances owned by
heat stacks. Using a separate domain allows for separation between the instances and the user deploying the stack. This allows regular users without administrative rights to deploy heat stacks that require such credentials.
Procedure 9.3. Creating an Identity Service Domain for the Orchestration Service
- Obtain the administrative token used by the Identity service. This token is the value of the
admin_tokenconfiguration key in the/etc/keystone/keystone.conffile of the Identity server:cat /etc/keystone/keystone.conf | grep admin_token admin_token = 0292d404a88c4f269383ff28a3839ab4
# cat /etc/keystone/keystone.conf | grep admin_token admin_token = 0292d404a88c4f269383ff28a3839ab4Copy to Clipboard Copied! Toggle word wrap Toggle overflow The administrative token is used to perform all actions requiring administrative credentials. - Install the python-openstackclient package on the Red Hat Enterprise Linux 7.1 host you will use to create and configure the domain:
yum install python-openstackclient
# yum install python-openstackclientCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the rest of the steps in this procedure from the Red Hat Enterprise Linux 7.1 host. - Create the
heatdomain:openstack --os-token ADMIN_TOKEN --os-url=IDENTITY_IP:5000/v3 \ --os-identity-api-version=3 domain create heat \ --description "Owns users and projects created by heat"
# openstack --os-token ADMIN_TOKEN --os-url=IDENTITY_IP:5000/v3 \ --os-identity-api-version=3 domain create heat \ --description "Owns users and projects created by heat"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace ADMIN_TOKEN with the administrative token.
- Replace IDENTITY_IP with the IP or host name of the server hosting the Identity service.
This command returns the domain ID of theheatdomain. This ID (HEAT_DOMAIN_ID) is used in the next step. - Create a user named
heat_domain_adminthat can have administrative rights within theheatdomain:openstack --os-token ADMIN_TOKEN --os-url=IDENTITY_IP:5000/v3 \ --os-identity-api-version=3 user create heat_domain_admin \ --password PASSWORD \ --domain HEAT_DOMAIN_ID
# openstack --os-token ADMIN_TOKEN --os-url=IDENTITY_IP:5000/v3 \ --os-identity-api-version=3 user create heat_domain_admin \ --password PASSWORD \ --domain HEAT_DOMAIN_ID --description "Manages users and projects created by heat"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with a password for this user. This command returns a user ID (DOMAIN_ADMIN_ID), which is used in the next step. - Grant the
heat_domain_adminuser administrative rights within theheatdomain:openstack --os-token ADMIN_TOKEN --os-url=IDENTITY_IP:5000/v3 \ --os-identity-api-version=3 role add --user DOMAIN_ADMIN_ID \ --domain HEAT_DOMAIN_ID admin
# openstack --os-token ADMIN_TOKEN --os-url=IDENTITY_IP:5000/v3 \ --os-identity-api-version=3 role add --user DOMAIN_ADMIN_ID \ --domain HEAT_DOMAIN_ID adminCopy to Clipboard Copied! Toggle word wrap Toggle overflow - On the server hosting the Orchestration service, configure the service to use the
heatdomain and user:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.2.4. Configure Orchestration Service Authentication 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Configure the Orchestration service to use the Identity service for authentication. All steps in this procedure must be performed on each system hosting Orchestration services, while logged in as the
root user.
Procedure 9.4. Configuring the Orchestration Service to Authenticate Through the Identity Service
- Set the Orchestration services to authenticate as the correct tenant:
openstack-config --set /etc/heat/heat.conf \ keystone_authtoken admin_tenant_name services
# openstack-config --set /etc/heat/heat.conf \ keystone_authtoken admin_tenant_name servicesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace services is the name of the tenant created for the use of the Orchestration service. Examples in this guide useservices. - Set the Orchestration services to authenticate using the
heatadministrative user account:openstack-config --set /etc/heat/heat.conf \ keystone_authtoken admin_user heat
# openstack-config --set /etc/heat/heat.conf \ keystone_authtoken admin_user heatCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Orchestration services to use the correct
heatadministrative user account password:openstack-config --set /etc/heat/heat.conf \ keystone_authtoken admin_password PASSWORD
# openstack-config --set /etc/heat/heat.conf \ keystone_authtoken admin_password PASSWORDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace PASSWORD with the password set when theheatuser was created. - Set the Identity service host that the Orchestration services must use:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace KEYSTONE_HOST with the IP address or host name of the server hosting the Identity service. If the Identity service is hosted on the same system, use127.0.0.1. - Configure the
heat-api-cfnandheat-api-cloudwatchservice host names to which virtual machine instances will connect:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace HEAT_CFN_HOST with the IP address or host name of the server hosting the
heat-api-cfnservice. - Replace HEAT_CLOUDWATCH_HOST with the IP address or host name of the server hosting the
heat-api-cloudwatchservice.
Important
Even if all services are hosted on the same system, do not use127.0.0.1for either service host name. This IP address refers to the local host of each instance, and would therefore prevent the instance from reaching the actual service. - Application templates use wait conditions and signaling for orchestration. Define the Identity role for users that should receive progress data. By default, this role is
heat_stack_user:openstack-config --set /etc/heat/heat.conf \ DEFAULT heat_stack_user_role heat_stack_user
# openstack-config --set /etc/heat/heat.conf \ DEFAULT heat_stack_user_role heat_stack_userCopy to Clipboard Copied! Toggle word wrap Toggle overflow
RabbitMQ is the default (and recommended) message broker. The RabbitMQ messaging service is provided by the rabbitmq-server package. All steps in the following procedure must be performed on system hosting the Orchestration controller service, while logged in as the
root user.
Procedure 9.5. Configuring the Orchestration Service to use the RabbitMQ Message Broker
- Set RabbitMQ as the RPC back end:
openstack-config --set /etc/heat/heat.conf \ DEFAULT rpc_backend heat.openstack.common.rpc.impl_kombu
# openstack-config --set /etc/heat/heat.conf \ DEFAULT rpc_backend heat.openstack.common.rpc.impl_kombuCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the Orchestration service to connect to the RabbitMQ host:
openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_host RABBITMQ_HOST
# openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_host RABBITMQ_HOSTCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace RABBITMQ_HOST with the IP address or host name of the message broker. - Set the message broker port to
5672:openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_port 5672
# openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_port 5672Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the RabbitMQ user name and password created for the Orchestration service when RabbitMQ was configured:
openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_userid heat openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_password HEAT_PASS
# openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_userid heat # openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_password HEAT_PASSCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replaceheatand HEAT_PASS with the RabbitMQ user name and password created for the Orchestration service. - When RabbitMQ was launched, the
heatuser was granted read and write permissions to all resources: specifically, through the virtual host/. Configure the Orchestration service to connect to this virtual host:openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_virtual_host /
# openstack-config --set /etc/heat/heat.conf \ DEFAULT rabbit_virtual_host /Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you enabled SSL on the message broker, you must configure the Orchestration service accordingly. This procedure requires the exported client certificates and key file. See Section 2.3.5, “Export an SSL Certificate for Clients” for instructions on how to export these files.
Procedure 9.6. Enabling SSL Communication Between the Orchestration Service and the RabbitMQ Message Broker
- Enable SSL communication with the message broker:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the following values:- Replace /path/to/client.crt with the absolute path to the exported client certificate.
- Replace /path/to/clientkeyfile.key with the absolute path to the exported client key file.
- If your certificates were signed by a third-party Certificate Authority (CA), you must also run the following command:
openstack-config --set /etc/heat/heat.conf \ DEFAULT kombu_ssl_ca_certs /path/to/ca.crt
# openstack-config --set /etc/heat/heat.conf \ DEFAULT kombu_ssl_ca_certs /path/to/ca.crtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace /path/to/ca.crt with the absolute path to the CA file provided by the third-party CA (see Section 2.3.4, “Enable SSL on the RabbitMQ Message Broker” for more information).