-
Language:
English
-
Language:
English
2.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.
Note
See the OpenShift Enterprise Deployment Guide for more information on using an external routing layer for high-availability applications, including how to configure the sample routing plug-in and routing daemon.
Procedure 2.3. To Enable Support for High-Availability Applications:
- 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 theALLOW_HA_APPLICATIONS
parameter to"true"
:ALLOW_HA_APPLICATIONS="true"
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. - A scaled application that is not highly available uses the following URL form:
http://${APP_NAME}-${DOMAIN_NAME}.${CLOUD_DOMAIN}
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}
To change the prefix or suffix used in the high-availability URL, you can modify theHA_DNS_PREFIX
orHA_DNS_SUFFIX
parameters:HA_DNS_PREFIX="ha-" HA_DNS_SUFFIX=""
If you modify theHA_DNS_PREFIX
parameter and are using the sample routing daemon, ensure this parameter and theHA_DNS_PREFIX
parameter in the/etc/openshift/routing-daemon.conf
file are set to the same value. - 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 theMANAGE_HA_DNS
parameter to"true"
:MANAGE_HA_DNS="true"
Then set theROUTER_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"
- For developers to enable high-availability support with their scalable applications, they must have the
HA allowed
capability enabled on their account. By default, theDEFAULT_ALLOW_HA
parameter is set to"false"
, which means user accounts are created with theHA allowed
capability initially disabled. To have this capability enabled by default for new user accounts, setDEFAULT_ALLOW_HA
to"true"
:DEFAULT_ALLOW_HA="true"
You can also adjust theHA allowed
capability per user account using theoo-admin-ctl-user
command with the--allowha
option:#
oo-admin-ctl-user -l user --allowha true
- To make any changes made to the
/etc/openshift/broker.conf
file take effect, restart the broker service:#
service openshift-broker restart
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.