Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write a bootstrap action to download a file to each node in EMR?

I'm trying to download a postgres driver to each node of my cluster. I wrote the following bootstrap action, but it doesn't seem to have worked:

#!/bin/bash
aws s3 cp s3://path/to/driver/jars/postgresql-9.4.1210.jre7.jar .

I know this must be an easy thing to do, but I can't seem to find an obvious example.

like image 657
Evan Zamir Avatar asked Nov 18 '25 14:11

Evan Zamir


1 Answers

The bootstrap action you have looks fine and is probably working. It's just that you are probably assuming that it will download the file to the same directory where you land when ssh'ing to the cluster, which is /home/hadoop, but that is not the case. The working directory of bootstrap actions is somewhere under /var/lib/bootstrap-actions, if I remember correctly.

It would be easier to find the file you've downloaded if you change "." to something like "/home/hadoop". You could also create some other new directory to which to download the file as part of this script (using "sudo mkdir" and "sudo chown" if necessary).

like image 184
Jonathan Kelly Avatar answered Nov 20 '25 04:11

Jonathan Kelly