Knowledgebase:
MarkLogic on AWS: EC2 Upgrade procedure to 1-click AMIs
06 November 2017 05:38 AM

Introduction

This article details changes to the upgrade procedures for MarkLogic 9 AMIs.

MarkLogic 9 now supports 1-click deployment in AWS Marketplace. This is an addition to existing options of manual launch of an AMI and launching MarkLogic clusters via CloudFormation templates. In order to make 1-click launch possible, our AMIs have pre-configured data volume (device on /dev/sdf).  The updated cloud formation templates account for the pre-configured data volume. This change also requires a different approach to our documented upgrade process.

Details

As per MarkLogic EC2 Guide, the main goal of the upgrade is to update AMI IDs in CloudFormation in order to upgrade all instances in the stack. There is now an additional step to handle the blank data volume that is pre-configured on MarkLogic AMIs.

Always backup your data before attempting any upgrade procedures!

Scenario 1:  You are using unmodified CF templates that were published by MarkLogic on http://developer.marklogic.com/products/cloud/aws starting from version 8.0-3.

  1. Update your CloudFormation stack with the latest template as there were no breaking changes since 8.0-3. The current templates for MarkLogic 9 include new AWS regions, new AMI IDs, and code to remove blank data volume that is bundled with current AMIs.
  2. In the EC2 Dashboard, stop one instance at the time and wait for it to be replaced with a new one.
  3. For a rolling upgrade (and as a good practice) terminate the other nodes one by one starting with the node that has Security database. They will come up and reconnect without any UI interaction.
  4. Go to 8001 port on any new instance where an upgrade prompt should be displayed.
  5. Click OK and wait for the upgrade to complete on the instance.

Scenario 2: You made some changes to MarkLogic templates or you are using custom templates.

  1. Download current templates from http://developer.marklogic.com/products/cloud/aws.
  2. Locate the AMI IDs by searching for "AWSRegionArch2AMI" block in the template.
    "AWSRegionArch2AMI": {
          "us-east-1": {
            "HVM": "ami-54a8652e"
          },
          "us-east-2": {
            "HVM": "ami-2ab29f4f"
          }, ...
  3. Locate AMI IDs in the old template and replace them with the ones from the new template. 
  4. Locate "BlockDeviceMappings" section in the new template that was downloaded in step 1. This block of code was added to remove blank volume that is part of the new 1-click AMIs.
  5. Update the old template to include "BlockDeviceMappings" as a property of LaunchConfig. There will be one or three LaunchConfig blocks depending on the template used. Those can by located by searching for "AWS::AutoScaling::LaunchConfiguration". Here is an example of the new property under LaunchConfig.
    "LaunchConfig":
    {
      "Type":"AWS::AutoScaling::LaunchConfiguration",
    "Properties":
    {
    "BlockDeviceMappings":
    [{
    "DeviceName":"/dev/sdf",
    "NoDevice":true,
    "Ebs": {}
    }],
    ...
  6. Once all the changes are saved, update your stack with the updated CloudFormation template. Make sure the stack update is complete.
  7. In the EC2 Dashboard, terminate nodes one by one starting with the node that has Security database. New nodes will come up after a couple of minutes and reconnect without any UI interaction.
  8. Wait for all nodes to be up and in green state.
  9. Go to 8001 port on any new instance where an upgrade prompt should be displayed.
  10. Click OK and wait for the upgrade to complete on the instance.

Scenario 3: You have instances that were brought up directly from MarkLogic AMI. For each MarkLogic instance in your cluster, do the following:

  1. Terminate the instance.
  2. Launch a new instance from the upgraded AMI.
  3. Detach blank volume that is mounted on /dev/sdf (should be 10GB in size)
  4. Attach the EBS data volume associated with the original instance.

More details on how to update CloudFormation stack can be found at http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html

(3 vote(s))
Helpful
Not helpful

Comments (0)