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, TDQG_DEPLOYMENT.sh 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
The following software is installed automatically if not already installed on the node:
- OpenJDK 11 if Java is not already present
- JQ
- ACL
- 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.
- Download the node package, see Downloading Required Packages.
- Unzip the package using the tar -xzvf tdqg-node-version.tar.gz command.TDQG_DEPLOYMENT.sh is available in the qgdeployment/aws path.
- Create a file named config to store the AWS configuration variables.
[default] output = json region = us-west-2
- Upload the TDQG_DEPLOYMENT.sh script, tdqg-node.json token, and config file to an AWS S3 Bucket.
- Create an IAM role with the following policy permissions:
Policy Permissions EC2 - DescribeAvailabilityZones
- DescribeInstances
- TerminateInstances
EC2 Auto Scaling - DescribeAutoScalingGroups
- DescribeAutoScalingInstances
- TerminateInstanceInAutoScalingGroup
AmazonS3ReadOnly Access – - 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:
#!/bin/bash # 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> TDQG_DEPLOYMENT.001.sh aws s3 cp <s3-uri-path-to-config> config # Permission to run TDQG_DEPLOYMENT.sh chmod 655 tdqg-node.json chmod 655 TDQG_DEPLOYMENT.001.sh mkdir ~/.aws mv config ~/.aws/ # Run deployment script ./TDQG_DEPLOYMENT.001.sh --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. - In AWS Auto Scaling Groups, select Create Auto Scaling group and provide the following in Scaling policies:
- Select Target tracking scaling policy.
- Provide the policy name and define the metric for scale-out.
- 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.