4.12. Manual Scaling a Running Presto Cluster#

Using the CloudFormation template, you can scale your cluster up and down to match demand. Alternatively you can use automatic scaling.

Add or Remove Workers Using the AWS CloudFormation Console#

1. CloudFormation Console
Navigate to the CloudFormation Console under “Management Tools” within the Services menu.
2. Choose a Stack
Select the Presto cluster (CloudFormation stack) you wish to alter.
3. Actions Menu
Navigate to the Actions drop-down menu and click “Update Stack”.
4. Select Template

Once you have arrived at the Select Template page within your stack update, you can find a pre-populated field under “Amazon S3 template URL”. Click “next”. Note, selecting “Use current template” achieves the same result.

../_images/presto_cft_update_template.png
5. Specify Details

Within the Specify Details page navigate to the “Workers Count” field and increase and decrease the node count to meet your needs.

../_images/presto_cft_update_workers.png
6. Review and Update
Navigate through to the Review page and look over your changes. When content, click “Update” to conclude the up-scale/down-scale of your cluster.

Add and Remove an Instance Using the AWS CLI#

1. Open a Terminal Window
Open a terminal window to begin a command line.
2. Update Stack
Use the update stack command to initiate the update of your cluster (CloudFormation stack).
aws cloudformation update-stack
3. Choose a Stack
Specify the name or unique stack ID of the cluster to update.
--stack-name (string)
4. Select Template

Indicate the template you used to create your cluster.

Set Previous: Reuse the existing template that is associated with the cluster that you are updating. Set UsePreviousTemplate to true.

--use-previous-template
5. Add or Remove Instances
Specify a new value for the WorkersCount parameter and indicate to the AWS CLI that you do not want to change value of any other parameters.
ParameterKey=WorkersCount,ParameterValue= 1

Reference the Example section below for a complete example of what to enter
into the CLI.
6. Review and Update

Finally, review the details of your cluster and your commands. When content, proceed by pressing enter to finish updating your cluster.

See the following create-stacks command as a reference for your cluster update:

 aws cloudformation update-stack \
 --stack-name teststack \
 --use-previous-template \
 --parameters \
 "ParameterKey=VPC,UsePreviousValue=true" \
 "ParameterKey=Subnet,UsePreviousValue=true" \
 "ParameterKey=SecurityGroups,UsePreviousValue=true" \
 "ParameterKey=CoordinatorInstanceType,UsePreviousValue=true"\
 "ParameterKey=WorkersInstanceType,UsePreviousValue=true" \
 "ParameterKey=KeyName,UsePreviousValue=true" \
 "ParameterKey=IamInstanceProfile,UsePreviousValue=true" \
 "ParameterKey=WorkersCount,ParameterValue=3" \
 "ParameterKey=LaunchSuperset,UsePreviousValue=true" \
 "ParameterKey=MetastoreType,UsePreviousValue=true" \
 "ParameterKey=ExternalMetastoreHost,UsePreviousValue=true" \
 "ParameterKey=ExternalMetastorePort,UsePreviousValue=true" \
 "ParameterKey=ExternalRdbmsMetastoreUserName,UsePreviousValue=true" \
 "ParameterKey=ExternalRdbmsMetastorePassword,UsePreviousValue=true" \
 "ParameterKey=ExternalRdbmsMetastoreDatabaseName,UsePreviousValue=true" \
 "ParameterKey=AdditionalCoordinatorConfigurationURI,UsePreviousValue=true" \
 "ParameterKey=AdditionalWorkersConfigurationURI,UsePreviousValue=true" \
 "ParameterKey=BootstrapScriptURI,UsePreviousValue=true"

The above commands yield output like the following:

{
  "StackId":"arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
}