Created
November 21, 2017 17:50
-
-
Save sunahsuh/c051e33545f35ef6fc630256af5d7be1 to your computer and use it in GitHub Desktop.
Download the driver's spark log given a cluster id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: download_spark_log.sh j-XXXXXXX <optional download path> | |
# Required: aws cli and jq | |
cluster=$1 | |
# Optional second argument defaults to . | |
dlLoc=${2:-\.} | |
instance=$(aws emr list-instances --cluster-id "$cluster" --instance-group-types MASTER | jq -r '.Instances[0].Ec2InstanceId') | |
logLocs3n=$(aws emr describe-cluster --cluster-id $cluster | jq -r '.Cluster.LogUri') | |
logLoc=${logLocs3n//s3n:/s3:} | |
aws s3 cp "$logLoc$cluster/node/$instance/applications/spark/spark.log.gz" $dlLoc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment