- Upload the new TDQG_DEPLOYMENT.sh script and the tdqg-node.json token to an AWS bucket.
- Create a new AWS EC2 Launch Template and provide the new startup script using the following method:
- 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. - Edit the Auto Scaling Group to use the newly created Launch Template.
- From the Auto Scaling Group controls, use the Start Instance Refresh option to refresh all the instances running the old template.Replacing all instances causes any running query to fail.
The new startup script automatically runs at startup.