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 and WildFly 
  • SQL databases - MySQL and MariaDB 10
  • NoSQL database - Couchbase

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 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
jpshttps://raw.githubuser...Provides 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.*
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.**
description"<p>Ready-to-work scalable MySQL...</p>"Displays a pop-up hint for the Auto-Clustering option in dashboard topology wizard.***
skipOnEnvInstalltrue | "http://..." | ["http://...", "http://..."]Forbids installation of the package specified via the ON_ENV_INSTALL variable.****

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
  • scalingMode - the scaling mode to be used (cannot be changed)
  • rules - allows redefying validation based on the specified settings

For example:
{
 "validation": {
   "minCount": 2,
   "maxCount": 3,
   "scalingMode": "stateless",
   "rules": {
     "scheme": {
       "master": {
         "maxCount": 2
       }
     }
   }
 }
}
3. 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

4. The following values are allowed to be used with the skipOnEnvInstall parameter:
  • true - prevents 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 into the appropriate stack template.

Adjust Stack Template

To enable clusterization for the certain software stack, the appropriate dockerfile should contain the cluster label, which will point to the clusterization package. The following values are supported:
  • “false” - disables clusterization for the stack (by default)
  • “true” - locates the script by attaching the jelastic/cluster.json suffix to the sourceUrl label
    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 it will be available for the certain software versions only.
The changes will be applied during template auto-update and/or 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 changes in the central part of the topology wizard.

glassfish auto-clustering

Tip: If needed, the new label for the Auto-Clustering feature in topology wizard can be hidden through adding the following line to the System Settings > User Interface > ENV_WIZARD_CONFIG setting in JCA:

“highlightNewFeatures”: false

hide dashboard new label

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 the minimum/maximum nodes count and/or scaling mode (e.g for the MySQL Group Replication type)

    auto-cluster topology validation
2. 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)

3. 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 your own clustering solutions.