注册API端点

注册API端点

除了``heat-api``软件包,Debian所有的API服务软件包,都会注册服务到认证服务目录。因为API端点很难记住所以这个特性是很有用的。

注解

配置Orchestration服务的是 heat-common 软件包而不是 heat-api 软件包。

当你安装一个API服务软件包时,你会被提示注册这个服务。不过,当你安装或者升级完成后,Debian会立即从debconf库中移除你对这个提示的选择。简单地说,就是当你被提示重新注册服务到认证服务时,如果你已经注册过API服务,当你升级时输入 ``no``即可。

../_images/api-endpoint_1_register_endpoint.png

下面这个屏幕显示,注册软件包到认证服务目录:

../_images/api-endpoint_2_keystone_server_ip.png

下面会提示您输入认证服务 admin_token``的值。认证服务使用这个值来注册API服务。当你设置``keystone 软件包时,这个值会自动配置。

../_images/api-endpoint_3_keystone_authtoken.png

下面这个屏幕是配置服务的IP地址。配置脚本会自动检测出连接到默认路由网卡上的IP地址。

除非你对你的网络有特别的设置,按下*ENTER**继续。

../_images/api-endpoint_4_service_endpoint_ip_address.png

下面这个屏幕配置服务的区域名称。例如:us-east-coast 或者 europe-paris.。

../_images/api-endpoint_5_region_name.png

Debian 包通过安装脚本会为您执行下列命令:

PKG_SERVICE_ID=$(pkgos_get_id keystone --os-token ${AUTH_TOKEN} \
  --os-endpoint http://${KEYSTONE_ENDPOINT_IP}:35357/v2.0/ service-create \
  --name ${SERVICE_NAME} --type ${SERVICE_TYPE} --description "${SERVICE_DESC}")
keystone --os-token ${AUTH_TOKEN} \
  --os-endpoint http://${KEYSTONE_ENDPOINT_IP}:35357/v2.0/
   endpoint-create \
  --region "${REGION_NAME}" --service_id ${PKG_SERVICE_ID} \
  --publicurl http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} \
  --internalurl http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL} \
  --adminurl http://${PKG_ENDPOINT_IP}:${SERVICE_PORT}${SERVICE_URL})

AUTH_TOKENKEYSTONE_ENDPOINT_IPPKG_ENDPOINT_IP``和``REGION_NAME 的值取决于你在debconf 提示时的回答。不过``SERVICE_NAME``, SERVICE_TYPESERVICE_DESC,和``SERVICE_URL`` 的值已经在每个包中提前配置好,所以你不用费力记住他们。

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.