Unknown macro: {next_previous_link3}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

A cartridge group defines the relationship among a set of cartridge groups and a set of cartridges. The relationship among the children of a group can be the startup order, termination behavior and any scalable dependencies. Writing a cartridge group definition provides the ability to re-use the same frequently used cartridges as needed in different composite applications. The cartridges that correspond to a cartridge group have to be added to WSO2 Private PaaS before the cartridge group is added. A sample cartridge group definition, together with information on all the properties that can be added in a cartridge group definition JSON are as follows:

Sample cartridge group definition JSON

The following are sample configurations that can be used in a JSON to define a cartridge group:

{
  "name": "esb-php-group",
  "cartridges": [
    "esb",
    "php"
  ],
  "dependencies": {
    "startupOrders": [
      {
        "aliases": [
          "cartridge.my-esb",
          "cartridge.my-php"
        ]
      }
    ],
    "terminationBehaviour": "terminate-none"
  }
}

Property definitions

All the properties that correspond to the cartridge group resource are explained as follows: 

  • W = Writable
  • R = Readable
  • U = Updatable
  • M = Mandatory (Required)
  • DV = Default Value

Main property definitions

PropertyWRU

Description

MDVData
Type 
Example
JSONUI
nameGroup Name The name of the group.YesN/AStringgroup 1
groupsgroups 

Defines all other nested groups within the group.

  groups
array
 
cartridgescartridges If the group refers to any cartridges, then such details needs to be mentioned under this parameter. When defining cartridges, you need to use the name of the cartridge.YesN/Acartridges arraytomcat, php
dependenciesDependencies Defines the dependency that exists between members (cartridge or a group). For more information on the sub-properties, see dependencies.YesN/Adependencies 

Sub-property definitions

dependencies
PropertyWRUDescriptionMDVData
Type 
Example
JSONUI
startupOrdersStartup Orders 

The order in which the group’s children (sub groups and cartridges) need to started up.

If it is a group, it should use the format of "group.<GROUP_ALIAS>" and if it is a cartridge, it should be "cartridge.<CARTRIDGE_ALIAS>" when defining startupOrder. Multiple startupOrders can also be defined as String array. However, the startupOrder should not create a cyclic dependency. By defining multiple startupOrders, parallel dependencies can be identified to start them in parallel.

  • If the startupOrder is as follows, group3, group1 should come before tomcat and php. However, tomcat or php can come up in any order.

    "startupOrders": [
      {
        "aliases": [
          "group.group3",
          "cartridge.tomcat"
        ]
      },
      {
        "aliases": [
          "group.group1",
          "cartridge.php"
        ]
      }
    ],
  • If the startupOrder is as follows, then group1 will come up first, then tomcat and then php.

    "startupOrders": [
      {
       "aliases":[ 
         "group.group1",
         "cartridge.tomcat",
         "cartridge.php"
         ]
       }
    ],
  • If the startupOrder has two independent rules defined as follows, then once group1 is brought up, tomcat and php can be brought up in parallel.

    "startupOrders": [
      {
        "aliases": [
          "group.group1",
          "cartridge.tomcat"
        ]
      },
      {
        "aliases": [
          "group.group1",
          "cartridge.php"
        ]
      }
    ],
  • If a startupOrder is not defined then the groups or cartridges will be started up parallel to each other.

NoN/AstartupOrders arraygroup.group1, cartridge.tomcat

terminationBehaviour

Termination Behaviour 

This determines how the instances need to be terminated. The following is the example startupOrder used to explain the terminationBehaviour:

"startupOrders": [
  {
    "aliases": [
      "group.group1",
      "cartridge.tomcat"
    ]
  },
  {
    "aliases": [
      "group.group1",
      "cartridge.php"
    ]
  }
],

The available terminationBehaviours are as follows:

  • terminate-none
    None of the children in a group will be terminated. For example, if something happens to group1, it will not have an impact on tomcat or php.
  • terminate-all
    All the elements in that dependency tree will be terminated. For example, if something happens to php, then all the children of the group that php belongs to, will be get terminated regardless of the other dependency information. Note that cartridges and sub-groups are considered as the children of a group.
  • terminate-dependents
    Only the dependents will be terminated.
    For example:
    • If something happens to group1, then tomcat and php will get terminated. However, if any other cartridge or group is found in the parent group that group1 belongs to, then that cartridge or group will remain as it is in WSO2 Private PaaS.
    • If something happens to php, nothing will get terminated as php does not have any dependancies.
NoN/AStringterminate-dependent,
terminate-all,
terminate-none
scalingDependents
Scaling Dependents 

Defines if there are any dependencies with regard to scaling. When dependent scaling is defined among members (cartridge or a group), and scaling (scaling up or down) is taking place for any of the members, all other dependent members will also scale in order to maintain the defined ratio.

For more information, see Dependent Scaling.

NoN/A

scalingDependents array 

group.group1,
cartridge.tomcat

  • No labels