cloudsoft.io

Rolling Upgrades

A rolling upgrade is an upgrade of a software, performed without downtime or other disruption of service. Typically, hosts in a cluster are upgraded one by one.

RepaveBatchEffector

The following example demonstrates application of RepaveBatchEffector to facilitate rolling upgrade:

tosca_definitions_version: tosca_simple_yaml_1_3
topology_template:
  node_templates:
    my_cluster_template:
      type: org.apache.brooklyn.entity.webapp.DynamicWebAppCluster
      properties:
        cluster.initial.size: 2
        dynamiccluster.quarantineFailedEntities: false
        dynamiccluster.memberspec:
          '$brooklyn:entitySpec':
            type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
            brooklyn.config:
              wars.root: https://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.7.0-incubating/brooklyn-example-hello-world-sql-webapp-0.7.0-incubating.war
  groups:
    - add_brooklyn_types:
        members: [my_cluster_template]
        type: brooklyn.tosca.groups.initializer
        properties:
          brooklyn.initializers:
            - type: io.cloudsoft.amp.initializer.RepaveBatchEffector
services:
  - type: org.apache.brooklyn.entity.webapp.DynamicWebAppCluster
    brooklyn.initializers:
      - type: io.cloudsoft.amp.initializer.RepaveBatchEffector
    brooklyn.config:
      cluster.initial.size: 2
      dynamiccluster.quarantineFailedEntities: false
      dynamiccluster.memberspec:
        '$brooklyn:entitySpec':
          type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
          brooklyn.config:
            wars.root: https://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.7.0-incubating/brooklyn-example-hello-world-sql-webapp-0.7.0-incubating.war

Size of DynamicWebAppCluster is 2, with hosts of type TomcatServer and a web application on each. Initial version of web application is 0.7.0-incubating. AMP initializer RepaveBatchEffector is attached to a cluster node and decorates cluster node with a repave effector. By calling repave effector on DynamicWebAppCluster with parameters batchSize: 1, effectorToInvoke: deploy and effectorArgs:

{
  "url": "https://repo1.maven.org/maven2/org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war",
  "targetName": "/"
}

re-deploys web application version 0.12.0, one by one in the cluster.