Powered by Zoomin Software. For more details please contactZoomin

Administrate MarkLogic Server

Upgrading an EC2 Instance

  • Last Updated: April 15, 2026
  • 3 minute read
    • MarkLogic Server
    • Version 11.0
    • Documentation

The process for performing a rolling upgrade in EC2 (AWS) is fairly simple. It is very similar to a normal update of the Cloud Formation templates. See Upgrading MarkLogic on AWS in Run on Amazon Web Services (AWS) for details about a normal update.

This example assumes an existing 3-node cluster from Cloud Formation templates. Before you upgrade your instance, you need to upgrade your Cloud Formation template to reference the new AMI (9.0 CF template). See MarkLogic on Amazon Web Services (AWS) for details about upgrading your templates.

Here are the additional steps:

  1. Back up any important data before performing the upgrade.

  2. Update the stack with your updated Cloud Formation template. Make sure the stack update is complete.

    Screenshot showing how to update the stack with the updated Cloud Formation Template.

    Note:

    We do not recommend that you automatically swap out the Cloud Formation template. Instead, make a copy of your existing template (if it contains the AMI IDs), edit just the AMI IDs, and then use that for the update. (If the AMI ID is passed as a parameter or other means, use those means).

  3. Starting with the node that contains the Security forest, terminate the instance in the EC2 dashboard and wait for it to be replaced with a new one. The host will automatically be restarted by the managed cluster feature.

    Screenshot showing the EC2 dashboard.

    Wait for the host to come back up (with new host name).

  4. In the EC2 dashboard, repeat the process to terminate the rest of the instances.

  5. Between node terminations, check the cluster state from the Query Console using this query:

    xquery version "1.0-ml";
    
    <hosts>{
    for $i in xdmp:host-name(xdmp:hosts())
    return (
    let $response := xdmp:http-get(concat("http://localhost:8002/manage/v2/hosts/",
     $i,"?view=status&amp;format=json"),
     <options xmlns="xdmp:http">
       <authentication method="digest">
         <username>admin</username>
         <password>admin</password>
       </authentication>
       <headers>
         <content-type>application/json</content-type>
       </headers>
     </options>)
     return (
       <host>
       <name>{$response[2]//*:name/data()}</name>
       <host-software-version>
       {$response[2]//*:software-version/value/data()}
       </host-software-version>
       <cluster-effective-version>
       {$response[2]//*:effective-version/value/data()}
       </cluster-effective-version>
       </host>
     )       
    )
    }</hosts>
    

    This screenshot shows that although two nodes now have the new host software version, the cluster effective version is still the old version: Screenshot showing the Query Console.

    You can also use JavaScript:

    var hostNames = []
    for (var hostName of xdmp.hosts()) {
      hostNames.push(xdmp.hostName(hostName))
    }
    
    var hosts = [];
    for (var hostName of hostNames) {
      var url = "http://localhost:8002/manage/v2/hosts/" + hostName + "?view=status&format=json"
      var response = xdmp.httpGet(url, {
        authentication: {
          method: "digest",
          username: "admin",
          password: "admin"
        },
        headers: {
          "content-type": "application/json"
        }
      });
    
      var responseData = response.toObject()[1].root;
    
      hosts.push({
        name: responseData.xpath('//*:name/string()'),
        "host-software-version": responseData.xpath('//*:software-version/value/data()'),
        "cluster-effective-version": responseData.xpath('//*:effective-version/value/data()')
      });
    }
    
    var result = "<hosts>";
    for (var j = 0; j < hosts.length; j++) {
      result += "<host>";
      result += "<name>" + hosts[j].name + "</name>";
      result += "<host-software-version>" + hosts[j]["host-software-version"] + "</host-software-version>";
      result += "<cluster-effective-version>" + hosts[j]["cluster-effective-version"] + "</cluster-effective-version>";
      result += "</host>";
    }
    result += "</hosts>";
    
    result
    
  6. When all nodes have been updated, check to verify that the upgrade is complete by checking the cluster effective version as in Step 5.

    This screenshot shows that all nodes have the new host software version and the new cluster effective version:
    Screenshot showing the Query Console.

  7. Navigating anywhere in the Admin Interface will prompt you to upgrade your Security database. To upgrade the Security database, go to http://{ec2-hostname}:8001/security-upgrade.xqy. When that has been done, then the upgrade is complete.

TitleResults for “How to create a CRG?”Also Available inAlert