Este contenido no está disponible en el idioma seleccionado.
8.6.4. Enabling Support for High-Availability Applications
Prerequisites:
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:
- To allow scalable applications to become highly available using the configured external router, edit the
/etc/openshift/broker.conffile on the broker host and set theALLOW_HA_APPLICATIONSparameter to"true":ALLOW_HA_APPLICATIONS="true"
ALLOW_HA_APPLICATIONS="true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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}http://${APP_NAME}-${DOMAIN_NAME}.${CLOUD_DOMAIN}Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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}http://${HA_DNS_PREFIX}${APP_NAME}-${DOMAIN_NAME}${HA_DNS_SUFFIX}.${CLOUD_DOMAIN}Copy to Clipboard Copied! Toggle word wrap Toggle overflow To change the prefix or suffix used in the high-availability URL, you can modify theHA_DNS_PREFIXorHA_DNS_SUFFIXparameters:HA_DNS_PREFIX="ha-" HA_DNS_SUFFIX=""
HA_DNS_PREFIX="ha-" HA_DNS_SUFFIX=""Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you modify theHA_DNS_PREFIXparameter and are using the sample routing daemon, ensure this parameter and theHA_DNS_PREFIXparameter in the/etc/openshift/routing-daemon.conffile 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_DNSparameter to"true":MANAGE_HA_DNS="true"
MANAGE_HA_DNS="true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Then set theROUTER_HOSTNAMEparameter 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"
ROUTER_HOSTNAME="www.example.com"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For developers to enable high-availability support with their scalable applications, they must have the
HA allowedcapability enabled on their account. By default, theDEFAULT_ALLOW_HAparameter is set to"false", which means user accounts are created with theHA allowedcapability initially disabled. To have this capability enabled by default for new user accounts, setDEFAULT_ALLOW_HAto"true":DEFAULT_ALLOW_HA="true"
DEFAULT_ALLOW_HA="true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can also adjust theHA allowedcapability per user account using theoo-admin-ctl-usercommand with the--allowhaoption:oo-admin-ctl-user -l user --allowha true
# 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 trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow - To make any changes made to the
/etc/openshift/broker.conffile take effect, restart the broker service:service openshift-broker restart
# service openshift-broker restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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.