Upgrade a node on Docker

Upgrade preparation

Load the new image

It is the same procedure as for the installation:

$ docker load -i DecisionInsight_2.0.0_Install_docker_BNYYYYYYYYYY.tar.gz
$ docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
axway/decisioninsight   YYYYYYYY-YY         54a353ed9eb7        About an hour ago   215.9 MB
axway/decisioninsight   XXXXXXXX-XX         4061a75db719        About an hour ago   215.9 MB

Create a new container

The procedure is the same no matter the type of volumes you are using. The command specifies reusing the same volumes than the previous container:

$ docker create -ti --name adi_YYYYYYYY-YY -p 18080:8080 --volumes-from=adi_XXXXXXXX-XX axway/decisioninsight:YYYYYYYY-YY
$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND            CREATED             STATUS              PORTS                     NAMES
eca059b396b5        axway/decisioninsight:YYYYYYYY-YY   "/opt/adi/node/b   2 seconds ago                                                     adi_20160919-02
b1018a5699ce        axway/decisioninsight:XXXXXXXX-XX   "/opt/adi/node/b   13 minutes ago      Up 9 minutes        0.0.0.0:18080->8080/tcp   adi_XXXXXXXX-XX

Configure a backup checkpoint

Customize your next shutdown checkpoint with a meaningful comment such as Before upgrade to YYYYYYYY-YY. Make sure the checkpoint is locked:

setShutdownCheckpointParameters true "Before upgrade to YYYYYYYY-YY"

Update execution

Stop the old container

$ docker stop --time 60 adi_XXXXXXXX-XX

You can check that the old container is stopped using:

$ docker ps -a
CONTAINER ID        IMAGE                               COMMAND                CREATED              STATUS                       PORTS                     NAMES
b1018a5699ce        axway/decisioninsight:XXXXXXXX-XX   "/opt/adi/platform/b   15 minutes ago       Exited (143) 9 seconds ago                             adi_XXXXXXXX-XX

Prepare the node configuration

  • Backup /opt/adi/node/conf in /opt/adi/var/backup-for-XXXXXXXX-XX
  • In /opt/adi/node/conf/platform.properties, set the autostart property to false, com.systar.aluminium.contexts.autostart=false. This property is needed to guard against an incorrect upgrade by avoiding data loss when the upgraded node starts.
$ docker run --rm --tty --interactive --user adi-admin --entrypoint=/bin/sh --volumes-from=adi_XXXXXXXX-XX axway/decisioninsight:XXXXXXXX-XX
/ # cp -R /opt/adi/node/conf /opt/adi/var/backup-for-XXXXXXXX-XX
/ # vi /opt/adi/node/conf/platform.properties
/ # exit

Start the new container

$ docker start adi_YYYYYYYY-YY

You can check that the new container is running using :

$ docker ps
CONTAINER ID        IMAGE                               COMMAND            CREATED              STATUS                       PORTS                     NAMES
eca059b396b5        axway/decisioninsight:YYYYYYYY-YY   "/opt/adi/node/b   About a minute ago   Up 4 seconds                 0.0.0.0:18080->8080/tcp   adi_YYYYYYYY-YY

You can check that the new container is running the new release:

$ docker logs adi_YYYYYYYY-YY  | grep "Starting platform"
### Starting platform 'DecisionInsight' ('Axway Decision Insight 2.0.0 YYYYYYYY-YY') in directory /opt/adi/platform
2016-04-10 12:03:22,339 [FelixStartLevel] INFO platform - Starting platform 'DecisionInsight' ('Axway Decision Insight 2.0.0 YYYYYYYY-YY') in directory '/opt/adi/platform'

Upgrade verification

Successfully updated 

If the update was performed correctly, the node automatically migrates the database to the new version and creates a checkpoint upon migration. The last steps in case of a successful upgrade are the following: 

  1. If the migration was successful, remove the com.systar.aluminium.contexts.autostart=false  property from /opt/adi/node/conf/platform.properties. Your routes will start again in automatic mode along with the node if the node is configured this way. 

  2. Either start your routes manually or restart the node so that your routes will start with the node if configured this way.
  3. Unlock the checkpoint created before the upgrade.
  4. Remove the old container with the docker rm command.

    $ docker rm adi_XXXXXXXX-XX
    adi_XXXXXXXX-XX
    $ docker ps -a
    CONTAINER ID        IMAGE                               COMMAND            CREATED             STATUS              PORTS                     NAMES
    eca059b396b5        axway/decisioninsight:YYYYYYYY-YY   "/opt/adi/node/b   6 minutes ago       Up 4 minutes        0.0.0.0:18080->8080/tcp   adi_YYYYYYYY-YY
  5. Remove the old image.

    If the old image is no longer used by any other container, it can be also removed with the docker rmi command:

    $ docker rmi axway/decisioninsight:XXXXXXXX-XX
    Untagged: axway/decisioninsight:XXXXXXXX-XX
    Deleted: 4061a75db719da5daa34d57a69365d4d16435d5dd0c19323e2ea1ad1eae023d9
    Deleted: 53432032d810013f0ed73f59c49971af4cdd835f71e9048c181454998de91ffc
    Deleted: e91efbb7671927d5beff7d99846c6103aab545e53f11eeef59533d5c2fa45440
    Deleted: 938630c06369e96826b7f40290abf8f79a3ccd36104caab82589f01929eeb418
    Deleted: 44899c0030e2655051b097eab5821b6a6f5046351559d0f6f0183a34d7df14dc
    Deleted: bff48cb73d31b83ca64fa734e4c60a6a93382b1baedc9bc9daae905d58cd4cef

Rollback

In the unlikely event that the upgrade is not successful, or if the process was abruptly interrupted during the migration, follow these steps to rollback the node to its previous state:

  1. Stop and rollback the node to the backup checkpoint. For more information, see How to rollback a node state to a specific checkpoint?
  2. Restore the /opt/adi/node/var/backup-for-XXXXXXXX-XX directory to /opt/adi/node/conf.

  3. Start the adi-XXXXXXXX-XX container.

Related Links