When deploying a cartridge, administrators need to sequentially deploy partitions, auto-scaling policies and deployment policies beforehand. Cartridges can be customized based on the following criteria:

Customization based on type

Apache Stratos supports three type of cartridges: Data, Application, and Framework. Administrators need to customize the providerfield, which is in the cartridge definition, to deploy a cartridge of a specific type.

"provider":"<CARTRIDGE-TYPE>"

Cartridge typeConfigurationExamples
Data"data"MySQL cartridge
Application"app"Wordpress cartridge
FrameworkAny term other than "data" and "app"PHP cartridge and Tomcat cartridge

For example, when you deploy a cartridge with the following configuration, it will be considered as a framework cartridge.
"provider":  "apache"  

Customization based on Load Balancer

A Load Balancer (LB) distributes the workload among multiple computing resources. While, it also scales up and down based on the load. Administrators can deploy cartridges using three approaches with regard to LB: using the default LB, using the service LB or not using a LB. Administrators need to customize the  provider field, which is in the Load Balancer cartridge configurations when deploying a Load Balancer Cartridge. 

"provider":"lb"

If the administrator is using a LB, the following configurations need to be added in the cartridge definition:

"loadBalancer": {
       "type": "lb-test",
       "property": {
           "name": "<LOAD-BALANCER-TYPE>",
           "value": "true"
       }
     }
LB TypeConfigurationDefinition
Default LB
"default.load.balancer"
Apache Stratos will automatically create a new LB instance for each network partition.
Service LB
"service.aware.load.balancer"
Apache Stratos will automatically create a new LB instance for each service spawned in a network partition.

Customization based on persistence storage

Persistent mapping is attaching a virtual hard drive as an additional storage to the cartridge instance. Persistence mapping is an optional functionality where it should be used only when you need additional storage to be added to the instance. Generally this is useful for data cartridges where an additional storage is required and also when the data stored should be preserved even in the case of instance termination. There are two steps that should be followed to obtain Stratos persistence volume support as follows: 

  1. Configure persistence volume support in the Cartridge definition. For more information on the configurations required, see Sample Cartridge Definition.
  2. Enable persistence volume support while subscribing from the UI or CLI. For more information on the configurations required when subscribing using the CLI, see subscribe-cartridge.

    Currently persistence volume support is fully tested only for AWS EC2.

The following configurations related to persistence storage need to be added in the Sample Cartridge Definition.

 "persistence": {
        "isRequired": "true",
        "volume" : [
            {
            "device": "/dev/sdc",
            "mappingPath": "/home/ubuntu/sdc",
            "size": "10",
            "removeOnTermination": "false"
            }
        ]
     }

The value entered for the size of the persistence volume during the subscription will override the value defined in the Cartridge definition JSON file. If the user has not provided the size of the volume during the subscription, then the values defined in the Cartridge definition JSON file will be used, specially when multiple persistence volumes are used.

For more information, see Persistence Volume Mapping on mapping a persistence volume to a cartridge.

Customization based on tenancy

Cartridges can operate in two modes: single tenant mode and multi-tenant mode. Single tenant cartridges maintain a separate instance for each tenant. Multi-tenant cartridges share an instance among multiple tenants. Single tenant cartridges provide process-level isolation and instance-level dedicated tenancy. Multiple tenants cannot be hosted in a single cartridge instance. Although multiple tenants share one cartridge instance, in multi-tenant cartridges each of the tenants' data will be isolated from each other.

Deploying a single tenant cartridge

Follow the instructions below to deploy a single tenant cartridge:

  1. Create and deploy a partition.
  2. Create and deploy an auto-scaling policy.
  3. Create and deploy a deployment policy.
  4. Optionally, create and deploy a Load Balancer (LB). As a cartridge can be created without a Load Balancer, creating a LB is not mandatory.
  5. Set the multiTenant field to false in the cartridge configurations:
    "multiTenant": "false",
  6. Create and deploy a cartridge.

Deploying a multi-tenant cartridge

When deploying a multi-tenant cartridge, you do not need to specify the Auto-scaling policy and Deployment policy, as it needs to be specified when deploying a multi-tenant service cluster.

Follow the instructions below to deploy a multi-tenant cartridge:

  1. Create and deploy a partition.
  2. Create and deploy an auto-scaling policy.
  3. Create and deploy a deployment policy.
  4. Optionally, create and deploy a Load Balancer (LB). As a cartridge can be created without a Load Balancer, creating a LB is not mandatory.
  5. Set the multiTenant field to true in the cartridge configurations:
    "multiTenant": "true",
  6. Create and deploy a cartridge.
  • No labels