#!/bin/bash kdc_password=$1 emr_domain=EC2.INTERNAL presto_engine=$2 #Hive metastore can be 'glue' or 'database' hive_metastore=${3-'database'} isMasterInstance=$(cat /mnt/var/lib/info/instance.json | jq '.isMaster') #if [ "${isMasterInstance}" == "true" ]; #then #sudo yum -y install krb5-server krb5-libs sudo kadmin -w "$kdc_password" -p kadmin/admin -q "addprinc -randkey presto/$(hostname -f)@${emr_domain}" sudo kadmin -w "$kdc_password" -p kadmin/admin -q "xst -k /etc/presto.keytab presto/$(hostname -f)@${emr_domain}" sudo chown presto:presto /etc/presto.keytab #Append to /etc/presto/conf/catalog/hive.properties if [ "${hive_metastore}" == "database" ]; then sudo tee -a /etc/presto/conf/catalog/hive.properties > /dev/null < /dev/null <