Multi Zones

Jelastic PaaS provides an ability to efficiently manage the hardware capacities of the platform with the help of the multi zones approach. The implementation extends the default anti-affinity rules for the applications high-availability, allowing to take control of the process directly.

The following two steps are required to configure and utilize the multi zones feature:

Note: Currently, the implementation is applicable for the JPS packages only (i.e. mostly suitable for Private Clouds). The support for the certified containers (Public Clouds) will be provided in the future platform releases.
The distribution is performed based on the number of existing nodes and hardware load rating. The exact multi zones distribution algorithm for containers addition is described in the appropriate section below.

Host Labels in JCA

To provide labels for your hardware servers, follow the steps below:

  1. Navigate to the JCA > Cluster > Hosts section and click the Change Labels button at the tools panel.

change host labels button in jca

  1. In the opened edit mode for labels, you can:
  • select the host(s), which should be adjusted, by ticking the required ones in the first column of the table
  • choose the type of adjustment from the appropriate drop-down list:
    • Add to Existing - adds the provided labels to the list of existing ones
    • Replace All with - adds the provided labels, while discarding all of the existing ones
    • Find and Remove these - removes labels that match the provided ones
    • Remove All - removes all of the labels
  • provide label(s) in the “{name}: {value}” format
    Tip: When providing labels, Jelastic automatically fetches a list of the already existing ones for quick management. Multiple options can be selected at once using the Ctrl key (double-click the added label to edit it). Also, you can hover over the particular label in the list and press F2 to add it in the edit mode.

edit labels mode for hosts

Notes:

  • you can view the full list of labels for the host (if it does not fit the column width) by hovering over the appropriate “” marking
  • just a single {value} can be provided for each unique {name} per host
  • the zone {name} is considered a default label and, if provided, is displayed first within the list
  • the maximum number of labels per host is 50
  • the maximum length of {name} is 63 and of {value} - 255; these values are validated by the “^[a-zA-Z0-9.-]+$” and “^[a-zA-Z0-9.-]*$” regex respectively

  1. For better clarity, all existing labels with the same {name} as the provided one (i.e. disk in the image below) are highlighted and moved to the left of the list. Herewith, if the existing {value} of such a label will be redefined, it is additionally colored in orange.

host labels list adjustment

When ready, click Apply to save changes or Cancel to discard them.

Distribution between Hosts in JPS

Once labels for hosts are configured in JCA, you can start managing the distribution criteria for the nodes in your JPS package. The appropriate distribution parameter defines the logic in the layer specifics, which consist of the following two options:

  • zones - sets a filter for allowed zones (groups of hosts custom-defined by labels) in the “{name}: {value}” format, e.g. zones: [{provider: azure}, {provider: amazon}]
  • mode - defines the behavior in case of the target zone unavailability
    • SOFT - the operation should proceed on the next zone/host defined by the multi zones algorithm (this option is used by default)
    • STRICT - the operation should be terminated with an error

    Notes:

    • the distribution is performed in the confines of a single host group (i.e. user environment region)
    • the default zone {name} can be skipped when providing zones parameter, i.e. the zones: [“a”, “b”] and zones: [{zone: a}, {zone: b}] expressions are equal
    • if zones with two or more {value} are specified for a single {name}, hosts with either of these values will be allowed for distribution
    • if zones with two or more {name} are specified, only hosts with all these labels will be allowed for distribution
    • if zones are not specified, distribution is performed across all hosts
    • the maximum number of elements in zones is 10
    • the maximum number of unique {value} per each {name} is 20

    For example, the distribution configured in the following package, ensures nodes are created only on the hosts with the disk: ssd label.

    name: "multi-zone"
    type: install
    
    nodes:
      nodeType: docker
      fixedCloudlets: 1
      flexibleCloudlets: 8
      image: jelastic/tomcat:latest
      count: 2
      distribution:
        mode: SOFT
        zones: 
        - disk: ssd
    

    Environments with custom distribution rules are marked with a dedicated custom label in the JCA > Cluster > Environments > Topology section, which allows viewing the layer distribution parameters.

    view distribution rules in jca

    For the detailed example on the multi zones distribution algorithm refer to the section below.

    Distribution Algorithm Example

    For example, we have a host group with six hosts and the following labels configured for them:

    NameLoadmarkLabelsApplication Containers
    hn0150provider:azure; disk:HDD2
    hn02100provider:azure; disk:HDD1
    hn0320provider:azure; disk:SSD-
    hn0420provider:amazon; disk:SSD1
    hn0520provider:amazon; disk:SSD1
    hn0650provider:amazon; disk:SSD1

    The distribution in the JPS package is defined with the following parameters:

    distribution:
        zones:
          - provider: "azure"
            disk: "HDD"
          - provider: "amazon"
            disk: "SSD"
    

    According to this data, JPS will distribute containers between two zones. For future reference, we’ll name them as follows:

    • zone1 - includes hosts with both provider:azure and disk:HDD labels: hn01, hn02
    • zone2 - includes hosts with both provider:amazon and disk:SSD labels: hn04, hn05, hn06

    So, let’s assume that we already have some Application Containers created (see the same-named column in the table above) and need to add one more node:

    1. A zone with the least number of nodes is selected. In case of equality, zone with the least loadmark (average from all the included hosts) is selected.

    In our case, both zone1 and zone2 have three containers, their loadmarks are (50+100)/2=75 and (20+20+50)/3=30 respectively. Thus, zone2 is selected.

    1. Next, the host within this zone should be selected. The process is similar, i.e. the host with the least number of containers and the lowest loadmark.

    In our case, all hosts within zone2 have the same number of containers (one on each), and the lowest loadmark is 20 on both hn04 and hn05. So, the target host will be selected from these two randomly.

    What’s next?