# HG changeset patch # User Henry S. Thompson # Date 1543345688 0 # Node ID 1b6bcc54268ddce2decc15a5b37b3a45b50f92e9 # Parent ad6eff2bc6f95d930d415ecad967dec329f27cbd what it says on the tin diff -r ad6eff2bc6f9 -r 1b6bcc54268d master/bin/hd_create.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/master/bin/hd_create.sh Tue Nov 27 19:08:08 2018 +0000 @@ -0,0 +1,28 @@ +#!/bin/bash +# Create an HDInsight cluster, and initialise ssh access to the head +u="Usage: hd_create.sh [-c filename] HDname\nWhere name is the name of an HDInsight cluster to create\nSaves config in named file if -c is present and file is writeable\n" +set -e -o pipefail +if [ $# -eq 1 ] +then + : +elif [ \( $# -eq 3 \) -a \( "$1" = "-c" \) -a \( ! -d "$2" \) ] +then + if >> "$2" 2>/dev/null + then + save_conf=" | tee \"$2\"" + shift 2 + else + printf "$u" 1>&2 + exit 1 + fi +else + printf "$u" 1>&2 + exit 2 +fi +name="$1" +cmd="az hdinsight create -g cc -n $name -l southcentralus -s 4 -t hadoop -p CommonCrawl_hd1 -U cc --storage-account ccscsg.blob.core.windows.net --workernode-size Standard_D13_V2 --headnode-size Standard_D12_V2$save_conf" +echo "Starting creation of $name, will take 15 minutes or so..." +echo $cmd +# remove old host key, if any +ssh-keygen -R cchd1-ssh.azurehdinsight.net +ssh cchd1-ssh.azurehdinsight.net "cat >> .ssh/authorized_keys" < /home/cc/.ssh/id_rsa.pub