0

I am using boto3 API to create an Amazon EMR cluster.

Using bootstrap actions, I am able to run script when the server is started. Can a similar action be done when I terminate the cluster, so that I am able to do actions like backup the metastore and data to S3 before the cluster is terminated?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
gpd
  • 180
  • 1
  • 13
  • Possible duplicate of [Is there a way to setup bootstrap actions to run on EMR after core services are installed (Spark etc)?](https://stackoverflow.com/questions/58211309/is-there-a-way-to-setup-bootstrap-actions-to-run-on-emr-after-core-services-are) – Lamanus Oct 10 '19 at 03:09
  • You can add steps to do something with the shell script. – Lamanus Oct 10 '19 at 03:17
  • 1
    What is triggering the termination of the cluster? Could the thing that is triggering the termination run a step first, wait for it to complete, then perform the termination? – John Rotenstein Oct 10 '19 at 04:27
  • @Lamanus it is not a duplicate of your question, in your case the steps have to be performed by after server is starting, however in my case i want to do steps just before the cluster is terminated, sort of like bootstrapping actions but for termination. – gpd Oct 10 '19 at 07:00
  • @JohnRotenstein thanks i'll give your approach a try. – gpd Oct 10 '19 at 07:01
  • You can do the termination by step with some job. I think this way is the only thing. – Lamanus Oct 10 '19 at 11:05

0 Answers0