Skip to content

Instantly share code, notes, and snippets.

@matthewberryman
Created June 7, 2016 03:39
Show Gist options
  • Save matthewberryman/c4d92a25611188e5ae6fe8539a14e749 to your computer and use it in GitHub Desktop.
Save matthewberryman/c4d92a25611188e5ae6fe8539a14e749 to your computer and use it in GitHub Desktop.
Script to run on a slave before adding it in hortonworks sandbox master
AMBSRV="master.localdomain"
# or insert local repo name here
HWXREPO="s3.amazonaws.com/public-repo-1.hortonworks.com"
export AMBARIREPO="https://$HWXREPO/ambari/centos6/1.x/updates/1.6.1/ambari.repo"
yum -y install net-snmp net-snmp-utils ntp wget
wait
wget $AMBARIREPO -O /etc/yum.repos.d/ambari.repo
sed -i 's/SELINUX=permissive/SELINUX=disabled/g;s/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
chkconfig --del iptables
iptables -F
service iptables stop
iptables -vnL
yum -y erase mysql-libs postgresql nagios ganglia ganglia-gmetad libganglia
wait
service ntpd start
chkconfig --add ntpd
chkconfig --levels 35 ntpd on
JDKLOC="http://$HWXREPO/ARTIFACTS/jdk-8u77-linux-x64.tar.gz"
wget $JDKLOC -O /tmp/jdk-8u77-linux-x64.tar.gz
mkdir -p /usr/java
tar -C /usr/java -zxvf /tmp/jdk-8u77-linux-x64.tar.gz
wait
echo "export JAVA_HOME=/usr/java/jdk1.8.0_77" > /etc/profile.d/java.sh
echo "export PATH=/usr/java/jdk1.8.0_77/bin:$PATH" >> /etc/profile.d/java.sh
echo "export PDSH_SSH_ARGS_APPEND=\"-o StrictHostKeyChecking=no\"" > /etc/profile.d/login.sh
source /etc/profile.d/java.sh
source /etc/profile.d/login.sh
wait
sed -i 's/gpgcheck=1/gpgcheck=0/' /etc/yum.conf /etc/yum.repos.d/*
yum clean all
wait
service iptables stop
yum -y install ambari-agent
wait
sed -i "s/^hostname=.*/hostname=$AMBSRV/" /etc/ambari-agent/conf/ambari-agent.ini
ambari-agent start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment