Skip to content

Instantly share code, notes, and snippets.

@abajwa-hw
Last active May 10, 2020 07:01
Show Gist options
  • Save abajwa-hw/7794ea013c96f3f41c4a8b10aeeccd4d to your computer and use it in GitHub Desktop.
Save abajwa-hw/7794ea013c96f3f41c4a8b10aeeccd4d to your computer and use it in GitHub Desktop.
vanilla HDP install
# Launch Centos/RHEL 7 VM with at least 8 vcpu / 32Gb+ memory / 100Gb disk
#To run - export any variables then execute below:
#export cluster_name=DESIRED_CLUSTER_NAME; curl -sSL https://gist.github.com/abajwa-hw/7794ea013c96f3f41c4a8b10aeeccd4d/raw | sudo -E sh
export cluster_name=${cluster_name:-hdp}
export ambari_password=${ambari_password:-BadPass#1} #Ambari password
export host_count=${host_count:-1} #choose number of nodes
export ambari_services=${ambari_services:-HDFS HIVE PIG MAPREDUCE2 TEZ YARN ZOOKEEPER ZEPPELIN AMBARI_INFRA_SOLR KAFKA SPARK2} #AMBARI_METRICS can be added post-install
export hdp_ver=${hdp_ver:-3.1}
export ambari_version=2.7.3.0
yum install -y git python-argparse mysql-connector-java*
cd ~
git clone https://github.com/seanorama/ambari-bootstrap.git
#remove unneeded repos for some AMIs
if [ -f /etc/yum.repos.d/zfs.repo ]; then
rm -f /etc/yum.repos.d/zfs.repo
fi
if [ -f /etc/yum.repos.d/lustre.repo ]; then
rm -f /etc/yum.repos.d/lustre.repo
fi
#install MySql community rpm
sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
export install_ambari_server=true
curl -sSL https://raw.githubusercontent.com/seanorama/ambari-bootstrap/master/ambari-bootstrap.sh | sudo -E sh
echo "Waiting 30s for Ambari to come up..."
sleep 30
echo "Changing Ambari password..."
curl -iv -u admin:admin -H "X-Requested-By: blah" -X PUT -d "{ \"Users\": { \"user_name\": \"admin\", \"old_password\": \"admin\", \"password\": \"${ambari_password}\" }}" http://localhost:8080/api/v1/users/admin
sudo ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar
echo "Setting recommendation strategy..."
export ambari_stack_version=${hdp_ver}
export recommendation_strategy="ALWAYS_APPLY_DONT_OVERRIDE_CUSTOM_VALUES"
echo "Generating BP and deploying cluster..."
cd ~/ambari-bootstrap/deploy
cat << EOF > configuration-custom.json
{
"configurations" : {
"core-site": {
"hadoop.proxyuser.root.users" : "admin",
"fs.trash.interval": "4320"
},
"yarn-env": {
"apptimelineserver_heapsize": "1024"
},
"hdfs-site": {
"dfs.replication": "1",
"dfs.namenode.safemode.threshold-pct": "0.99"
},
"hive-site": {
"hive.server2.transport.mode" : "binary"
}
}
}
EOF
./deploy-recommended-cluster.bash
##Once deployed run below to enable admin user to use Ambari views
# sudo -u hdfs hdfs dfs -mkdir /user/admin
# sudo -u hdfs hdfs dfs -chown admin /user/admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment