Auto-Clustering of Stack Templates

Jelastic PaaS provides auto-clustering for the following software templates (with even more coming in the near future):

  • application servers - GlassFish, Payara, WildFly
  • SQL databases - MySQL, MariaDB, PostgreSQL
  • NoSQL database - Couchbase, MongoDB
  • storage server - Shared Storage Container

To enable the Auto-Clustering feature for other stacks also, you need to configure the appropriate clusterization package and adjust the target stack templates. After such configurations, this functionality will be available within the topology wizard of the developers’ dashboard.

Clusterization Package

You should create a special clusterization package, which will describe the desired behavior on the wizard (UI) and point to the JPS package with all the required actions for the automatic configuration of a cluster. Below, we’ll provide all of the parameters with the possible values:

ParameterExample ValuesDescription
convertibletrue | falseDefines if clusterization can (false) or cannot (true) be enabled for the current stack layer.
jpshttps://raw.githubuserProvides a link to the manifest with the clusterization steps.
defaultStatetrue | falseDefines the default state of the Auto-Clustering switcher on the wizard (true/false for the enabled/disabled state, respectively).
requiredtrue | falseMakes the clusterization either obligatory (true) or optional (false) for the template.
nodeGroupData.
scalingMode
stateless | statefulSelects the preferable scaling mode for the node group (either stateless or stateful).
nodeGroupData.
skipNodeEmails
true | falseSkips (true) sending emails about new nodes addition or notifies as usual (false).
compatibleAddons[
"mysql-auto-cluster"
]
Skips clusterization if add-on from the list (i.e. array of IDs) is installed on the layer.[1]
settings.data{
"scheme”: “master"
}
Provides the default configurations for the cluster installation.
settings.fields{
"type”: “list”,
"caption”: “Scheme”,
…}
Lists additional fields and settings for the cluster.
validation{
“validation”: {
“minCount”: 2,
…}
Configures the validation settings.[2]
description

Ready-to-work scalable MySQL…

Displays a pop-up hint for the Auto-Clustering option in dashboard topology wizard.[3]
skipOnEnvInstall*true“http://…”
targetRegions{
"type”: “vz7"
}
Applies regions filtering for auto-cluster.
extraNodes{
"nodeGroup”: “proxysql”,
…}
Allows displaying the additional layers (uses regular node format) required for auto-clustering directly in the wizard.
recommended{
"cloudlets”: 16
}
Lists recommended resources for the auto-clustering. Currently, it supports the cloudlets option only.
requires[
"proxysql"
]
Lists an array of unpublished nodeType templates that can be used by the extraNodes

An extended description for some of the above-specified parameters:

  1. The compatibleAddons setting detects if the clusterization for the layer is already enabled via listed add-ons. It is required for compatibility reasons to support existing solutions with clusterization implemented through the ON_ENV_INSTALL variable (i.e. to avoid repetitive cluster enabling).

  2. The validation section allows restricting certain layer parameters (e.g. to forbid scaling of the DAS node in the GF cluster), namely:

  • minCount - the minimum nodes count
  • maxCount - the maximum nodes count
  • minCloudlets - the minimum cloudlets count
  • minExtip - the minimum IPv4 count
  • scalingMode - the scaling mode to be used (cannot be changed)
  • extraNodesCount - the number of nodes in extra layers upon enabling auto-cluster
  • tag - a Docer image that will be set for nodes in extra layer
  • rules - allows redefying validation based on the specified settings

For example:

"validation": {
  "minCount": 2,
  "minCloudlets": 2,
  "minExtip": 1,
  "scalingMode": "stateless",
  "extraNodesCount": 2,
  "tag": "...",
  "rules": {
    "scheme": {
      "mm": {
        "maxCount": 2
      }
    }
  }
}
  1. It is possible to apply localization for the hint in the description parameter through the appropriate keys in the localization file:
  • LT_EnvWizard_Tip_Cluster_default - the default description for the auto-clustering feature
  • LT_EnvWizard_Tip_Cluster_%(nodeType) - the template-specific description for the auto-clustering feature
  1. The following values are allowed to be used with the skipOnEnvInstall parameter:
  • true - prevents the execution of any package
  • {url} - blocks execution of the specific package (the one available via the link)
  • ["{url}”, “{url}”, …] - stops installation of any package from the array

After your clusterization package is prepared, you can add it to the appropriate stack template.

Adjust Stack Template

In order to enable a clusterization option for a particular software stack, the appropriate dockerfile should contain the cluster label. It will point to the clusterization package, using one of the following values:

  • “false” - disables clusterization for the stack (by default)
  • “true” - locates the script by attaching the jelastic/cluster.json suffix to the sourceUrl label
    Tip: For example, with the https://raw.githubusercontent.com/jelastic/ source URL, the clusterization script should be located at https://raw.githubusercontent.com/jelastic/jelastic/cluster.json.
  • {relativeUrl} - upends the sourceUrl label with the provided custom value
  • {absoluteUrl} - uses a specified direct link to the clusterization package

Tip: If needed, you can add the cluster label just to the specific template tags so that it will be available for the certain software versions only.
The changes will be applied during template auto-update and manual reimport.

User Experience

While working with the software stacks, which are provided with the out-of-box clusterization support, you can see the appropriate swithch in the central part of the topology wizard. glassfish auto-clustering

  1. Based on the specific implementation, the Auto-Clustering option can be:
  • mandatory enabled (e.g. for the Couchbase database) mandatory auto-clustering

  • provided with some additional settings (e.g. for the MySQL database) auto-cluster custom configuration field

  • restricted by resources (e.g. the minimum/maximum nodes count) and options (e.g. scaling mode) auto-cluster topology validation

  1. For the nodes created before the clusterization support was the implementation for the stack, the Auto-Clustering option can be:
  • disabled (hidden) - usually, this means automated reconfiguration is not possible or can affect the running application
  • already enabled - the same clusterization was installed (e.g. through the ON_ENV_INSTALL variable)
  1. While configuring a new JPS package, the default clusterization settings for the stack can be redefined (if allowed) via the appropriate cluster property.

For example:

{
 "nodeGroup": "mysql",
 "cluster": {
   "scheme": "master"
 }
}

Now, you know the specifics of the Auto-Clustering feature implementation and can configure clustering solutions on your own.

What’s next?