Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I shut down a RedShift cluster from the command line?

I want to shut down an AWS RedShift cluster through the command line, to avoid cluster charges in night time when no one use it.

I tried to search for the command, but didn't find it.

Anyone has idea about it?

like image 789
roy Avatar asked Oct 01 '14 20:10

roy


People also ask

How do I set up a redshift cluster?

If you're new to Amazon Redshift or just need a basic cluster, use Quick launch cluster. With this approach, you specify only the node type, number of nodes, user name, password, and AWS Identity and Access Management (IAM) role to use for access.

Why can’t I replace a node in my redshift cluster?

If you have a single-node cluster, the node cannot be replaced. To recover your cluster, restore a snapshot. For more information, see Amazon Redshift snapshots . Amazon Redshift cannot connect to the hardware security module (HSM). Check the HSM configuration between the cluster and HSM.

Why did Amazon Redshift Delete my cluster?

Amazon Redshift is taking a final snapshot of the cluster before deleting it. For more information, see Deleting a cluster . The cluster suffered a hardware failure. If you have a single-node cluster, the node cannot be replaced. To recover your cluster, restore a snapshot.

How do I shut down a failover cluster?

Shutting Down a Cluster. Shutting down the entire cluster involves stopping all roles and then stopping the Cluster Service on all nodes. While you can shut down each node in the cluster individually, using the cluster UI will ensure the shutdown is done gracefully. Open Failover Cluster Manager (CluAdmin.msc)


1 Answers

Sounds like you're looking for delete-cluster?

Example usage that takes a final snapshot:

aws redshift delete-cluster --cluster-identifier mycluster --final-cluster-snapshot-identifier myfinalsnapshot

You can use this snapshot with restore-from-cluster-snapshot to restore when you need to set the cluster up again:

aws redshift restore-from-cluster-snapshot --cluster-identifier mycluster-clone --snapshot-identifier my-snapshot-id

This is the most approximate way to perform a "shut down" operation as you've described -- you cannot start and stop RedShift like an EC2 instance, so you must destroy and recreate it instead. This will at least allow you to stop and start operations on your data.

like image 123
Anthony Neace Avatar answered Oct 03 '22 05:10

Anthony Neace