Last active
August 29, 2015 14:21
-
-
Save jkordish/7c042c54e99058cabb87 to your computer and use it in GitHub Desktop.
AWS EMR -- Add this as a bootstrap script to set all nodes to use the master hive.
This file contains hidden or 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
#!/bin/bash -ex | |
# Upload script to S3 bucket you are using for your cluster. | |
# Add the following after the Spark install bootstrap action | |
# --bootstrap-actions Name="Fix Hive",Path="s3://<s3_bucket>/hive-fix.sh" | |
export MASTER=$(hdfs getconf -namenodes) | |
if [ -f "/home/hadoop/hive/conf/hive-default.xml" ]; then | |
sed -i "s/jdbc:mysql:\/\/localhost:3306/jdbc:mysql:\/\/$MASTER:3306/g" /home/hadoop/hive/conf/hive-default.xml | |
fi | |
sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' IDENTIFIED BY 'hive'; FLUSH PRIVILEGES;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment