此内容没有您所选择的语言版本。

8.6.4. Enabling Support for High-Availability Applications


If you have configured an external routing layer, either the included sample or your own, to route application traffic, you must enable support for high-availability applications and configure specific DNS management options before developers can take advantage of these features.

Procedure 8.20. To Enable Support for High-Availability Applications:

  1. To allow scalable applications to become highly available using the configured external router, edit the /etc/openshift/broker.conf file on the broker host and set the ALLOW_HA_APPLICATIONS parameter to "true":
    ALLOW_HA_APPLICATIONS="true"
    Copy to Clipboard Toggle word wrap
    Note that this parameter controls whether high-availability applications are allowed in general, but does not adjust user account capabilities. User account capabilities are discussed in a later step.
  2. A scaled application that is not highly available uses the following URL form:
    http://${APP_NAME}-${DOMAIN_NAME}.${CLOUD_DOMAIN}
    Copy to Clipboard Toggle word wrap
    When high-availability is enabled, HAproxy instances are deployed in multiple gears of the application, which are spread across multiple node hosts. In order to load balance user requests, a high-availability application requires a new high-availability DNS name that points to the external routing layer rather than directly to the application head gear. The routing layer then forwards requests directly to the application's HAproxy instances, which are then distributed to the framework gears. In order to create DNS entries for high-availability applications that point to the routing layer, OpenShift Enterprise adds either a prefix or suffix, or both, to the regular application name:
    http://${HA_DNS_PREFIX}${APP_NAME}-${DOMAIN_NAME}${HA_DNS_SUFFIX}.${CLOUD_DOMAIN}
    Copy to Clipboard Toggle word wrap
    To change the prefix or suffix used in the high-availability URL, you can modify the HA_DNS_PREFIX or HA_DNS_SUFFIX parameters:
    HA_DNS_PREFIX="ha-"
    HA_DNS_SUFFIX=""
    Copy to Clipboard Toggle word wrap
    If you modify the HA_DNS_PREFIX parameter and are using the sample routing daemon, ensure this parameter and the HA_DNS_PREFIX parameter in the /etc/openshift/routing-daemon.conf file are set to the same value.
  3. DNS entries for high-availability applications can either be managed by OpenShift Enterprise or externally. By default, this parameter is set to "false", which means the entries must be created externally; failure to do so could prevent the application from receiving traffic through the external routing layer. To allow OpenShift Enterprise to create and delete these entries when applications are created and deleted, set the MANAGE_HA_DNS parameter to "true":
    MANAGE_HA_DNS="true"
    Copy to Clipboard Toggle word wrap
    Then set the ROUTER_HOSTNAME parameter to the public hostname of the external routing layer, which the DNS entries for high-availability applications point to. Note that the routing layer host must be resolvable by the broker:
    ROUTER_HOSTNAME="www.example.com"
    Copy to Clipboard Toggle word wrap
  4. For developers to enable high-availability support with their scalable applications, they must have the HA allowed capability enabled on their account. By default, the DEFAULT_ALLOW_HA parameter is set to "false", which means user accounts are created with the HA allowed capability initially disabled. To have this capability enabled by default for new user accounts, set DEFAULT_ALLOW_HA to "true":
    DEFAULT_ALLOW_HA="true"
    Copy to Clipboard Toggle word wrap
    You can also adjust the HA allowed capability per user account using the oo-admin-ctl-user command with the --allowha option:
    # oo-admin-ctl-user -l user --allowha trueoo-admin-ctl-user -l user --allowha trueoo-admin-ctl-user -l user --allowha trueoo-admin-ctl-user -l user --allowha true
    Copy to Clipboard Toggle word wrap
  5. To make any changes made to the /etc/openshift/broker.conf file take effect, restart the broker service:
    # service openshift-broker restart
    Copy to Clipboard Toggle word wrap

Note

You can also set the ratio or the number of HAProxy cartridges for scaled applications. See the oo-admin-ctl-app section in the OpenShift Enterprise Administration Guide at https://access.redhat.com/site/documentation for more information.
Note that this procedure only enables the support for high-availability applications. See the OpenShift Enterprise User Guide for a procedure on how a user can make an application highly-available.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat