# HG changeset patch # User Henry S. Thompson # Date 1543499503 0 # Node ID 93de42761f9c3b9547abe150c0d143941b757118 # Parent 9d4f130073b8d52e909e324045f87ba9dcac5baf parameterise name diff -r 9d4f130073b8 -r 93de42761f9c master/bin/hd_create.sh --- a/master/bin/hd_create.sh Thu Nov 29 13:41:27 2018 +0000 +++ b/master/bin/hd_create.sh Thu Nov 29 13:51:43 2018 +0000 @@ -1,6 +1,6 @@ #!/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" +u="Usage: hd_create.sh [-c filename] HDname\nWhere name will be prefixed with 'cc' to form\nthe name of an HDInsight cluster to create, and with 'CommonCrawl_' to give its password\nSaves config in named file if -c is present and file is writeable\n" set -e -o pipefail if [ $# -eq 1 ] then @@ -19,10 +19,12 @@ 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" +name=cc"$1" +pwd=CommonCrawl_"$1" echo "Starting creation of $name, will take 15 minutes or so..." -echo $cmd +cmd="az hdinsight create -g cc -n $name -l southcentralus -s 4 -t hadoop -p $pwd -U cc --storage-account ccscsg.blob.core.windows.net --workernode-size Standard_D13_V2 --headnode-size Standard_D12_V2" +bash -c "$cmd$save_conf" # 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 +ssh-keygen -R $name-ssh.azurehdinsight.net +# let us in w/o password after this +ssh $name-ssh.azurehdinsight.net "cat >> .ssh/authorized_keys" < /home/cc/.ssh/id_rsa.pub