Deploy QueryGrid on AWS Auto Scale | Teradata QueryGrid - Automatically Deploy QueryGrid on AWS Auto Scaling Group - Teradata QueryGrid

Teradata® QueryGrid™ Installation and User Guide

Teradata QueryGrid
Release Number
July 2022
English (United States)
Last Update
Product Category
Analytical Ecosystem
This option is available for use with the Oracle or Generic JDBC connector.

This procedure creates an auto-scalable cluster of AWS instances with QueryGrid installed. When deploying QueryGrid to hosts that are members of AWS Auto Scaling Group (ASG), you can automate the tdqg-node installations and registration process by specifying a bootstrap script that runs on all newly added members of the AWS ASG.

The required script, is packaged in the node package tdqg-node-version.tar.gz. The script, along with the tdqg-node.json token, must be uploaded to the AWS S3 Bucket and downloaded on to the instances using awscli through the userdata option of the AWS Launch Template.

This procedure assumes the following prerequisites:
  • You have required privileges to perform the following:
    • Create roles and policies in IAM
    • Upload files to an S3 Bucket
    • Create a Launch template and Auto Scaling Group
  • The cURL tool is installed on all nodes where you intend to install QueryGrid
  • The AWS CLI tool is installed on all nodes where you intend to install QueryGrid
Add the install commands to the user data if any of these tools are not available by default on the nodes.
The following software is installed automatically if not already installed on the node:
  • OpenJDK 11 if Java is not already present
  • JQ
  • ACL
  1. Add a system in Viewpoint and download the tdqg-node.json token file that was generated by the QueryGrid Manager.
    For information about downloading tdqg-node.json, see Adding Nodes Manually.
  2. Download the node package, see Downloading Required Packages.
  3. Unzip the package using the tar -xzvf tdqg-node-version.tar.gz command. is available in the qgdeployment/aws path.
  4. Create a file named config to store the AWS configuration variables.
    output = json
    region = us-west-2
  5. Upload the script, tdqg-node.json token, and config file to an AWS S3 Bucket.
  6. Create an IAM role with the following policy permissions:
    Policy Permissions
    • DescribeAvailabilityZones
    • DescribeInstances
    • TerminateInstances
    EC2 Auto Scaling
    • DescribeAutoScalingGroups
    • DescribeAutoScalingInstances
    • TerminateInstanceInAutoScalingGroup
    AmazonS3ReadOnly Access
  7. In AWS EC2 Launch Template, select Create Launch Template and provide the following information in Advanced Details:
    • IAM instance profile: Select the IAM role created previously
    • User data: Provide the following code snipped in the provided text area:
      # Download the files uploaded to S3 bucket
      aws s3 cp <s3-uri-path-to-tdqg_node> tdqg-node.json
      aws s3 cp <s3-uri-path-to-tdqg_deployment>
      aws s3 cp <s3-uri-path-to-config> config
      # Permission to run
      chmod 655 tdqg-node.json
      chmod 655
      mkdir ~/.aws
      mv config ~/.aws/
      # Run deployment script
      ./ --tdqg_node_json_file tdqg-node.json --scale-in-enabled true
    Step Action
    Optional scale-in-enabled:true
    This enables automated scale-in performed by the QueryGrid software when a driver host has been idle for a certain amount of time. When combined with an Autoscale only out policy defined in the ASG Scaling options, both scale in and scale out are automated.
    Because this task is performed by QueryGrid, if set to true, scale in occurs even if Scale-in rule is deleted.
  8. In AWS Auto Scaling Groups, select Create Auto Scaling group and provide the following in Scaling policies:
    1. Select Target tracking scaling policy.
    2. Provide the policy name and define the metric for scale-out.
    3. Enable Disable scale-in to create only a scale-out policy.
    Allowing AWS to perform the auto scale-in rather than using the QueryGrid scale-in enabled feature can cause queries to fail while the scale-in is being performed.