Here is my shell script which i wrote to make the process of installing the IBM biginsight (hadoop) on the lab. My team installed the hadoop using this script for around 70 systems, it saved lots of time for us, and we successfully conducted the workshop on it today.
#!/bin/bash
#generating keygen for the root user with no password
ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
echo "key generated in $HOME"
#append it to the authorized_keys
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
echo "appended to authorized_keys"
#create a usergroup
groupadd -g 168 biadmin
echo "group created"
#add a biadmin to the group
useradd -g biadmin -u 168 biadmin
echo "biadmin added to group"
#giving permission for the biadmin to run ssh and scp
chmod o+rx /usr/bin/ssh
chmod g+rx /usr/bin/ssh
chmod u+rx /usr/bin/scp
chmod o+rx /usr/bin/scp
echo "persmissions given"
#to edit the /etc/sudoers file
sed -e 's/# %wheel/%biadmin/g' -e 's/Defaults requiretty/#Defaults requiretty/g' /etc/sudoers >> /etc/sudoers
echo "changed to /etc/sudoers"
#add repo
rm -f /etc/yum.repos.d/*.repo
cp /root/Desktop/hadoop/new.repo /etc/yum.repos.d/
echo "added new.repo"
#preparing to install dependencies
yum clean all
#installing dependencies with(yes to all)
yum -y install tcl expect
#to disable selinux
sed -e 's/selinux=enabled/selinux=disabled/g' /etc/selinux/config >> /etc/selinux/config
#goto the bigdata directory
tar xzvf *.tar.gz
cd /root/Desktop/hadoop/biginsights-quickstart-linux64_b20130821_1818/
bash start.sh
#open firefox with the hyperlink
firefox "http://127.0.0.1:8300/Install/"
#finally append .bashrc file in biadmin
echo export PATH=$PATH:${PIG_HOME}/bin:${FLUME_HOME}/bin:${JAQL_HOME}/bin:${HIVE_HOME}/bin >> .bashrc
#!/bin/bash
#generating keygen for the root user with no password
ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N ''
echo "key generated in $HOME"
#append it to the authorized_keys
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
echo "appended to authorized_keys"
#create a usergroup
groupadd -g 168 biadmin
echo "group created"
#add a biadmin to the group
useradd -g biadmin -u 168 biadmin
echo "biadmin added to group"
#giving permission for the biadmin to run ssh and scp
chmod o+rx /usr/bin/ssh
chmod g+rx /usr/bin/ssh
chmod u+rx /usr/bin/scp
chmod o+rx /usr/bin/scp
echo "persmissions given"
#to edit the /etc/sudoers file
sed -e 's/# %wheel/%biadmin/g' -e 's/Defaults requiretty/#Defaults requiretty/g' /etc/sudoers >> /etc/sudoers
echo "changed to /etc/sudoers"
#add repo
rm -f /etc/yum.repos.d/*.repo
cp /root/Desktop/hadoop/new.repo /etc/yum.repos.d/
echo "added new.repo"
#preparing to install dependencies
yum clean all
#installing dependencies with(yes to all)
yum -y install tcl expect
#to disable selinux
sed -e 's/selinux=enabled/selinux=disabled/g' /etc/selinux/config >> /etc/selinux/config
#goto the bigdata directory
tar xzvf *.tar.gz
cd /root/Desktop/hadoop/biginsights-quickstart-linux64_b20130821_1818/
bash start.sh
#open firefox with the hyperlink
firefox "http://127.0.0.1:8300/Install/"
#finally append .bashrc file in biadmin
echo export PATH=$PATH:${PIG_HOME}/bin:${FLUME_HOME}/bin:${JAQL_HOME}/bin:${HIVE_HOME}/bin >> .bashrc
Comments
Post a Comment