Skip to main content

Workshop on IBM BIGDATA

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


Comments

Popular posts from this blog

ARP/RARP full simulation program

server.c #include "stdio.h" #include "stdlib.h" #include "string.h" #include "sys/types.h" #include "sys/socket.h" #include "arpa/inet.h" #include "netinet/in.h" #define SA struct sockaddr struct IPmac { char ip[100]; char mac[100]; }; int main() { int sockfd,len,i; struct sockaddr_in servaddr; char buff[30],temp[30],ip[30],mac[30];

Configure opendns in ubuntu 12.04

Today i have changed my dns server name to opendns. which is alternative to default dns and it provide more secure, faster browsing experience. What is opendns? OpenDNS is the leading provider of Internet security and DNS services Industry leading malware and botnet protection Award winning Web filtering Faster, reliable, more secure DNS Ultra-reliable, globally distributed cloud network Simple, Smart, Easy How to configure opendns in ubuntu 12.04: open terminal and type sudo nano /etc/resolv.conf enter your password and change these lines   nameserver 208.67.222.222  nameserver 208.67.220.220 to use google public dns use 8.8.8.8, 8.8.4.4 instead of 208.67.222.222, 208.67.220.220 simple isn't..! now see your facebook load faster than before. opendns comes with parental control, so never worry about unwanted websites, and your childrens are safe now. to check your dns changed successfully goto welcome.opendns.com

Given a string, reverse only vowels in it; leaving rest of the string as it is

/* Given a string, reverse only vowels in it; leaving rest of the string as it is. Input : abcdef Output : ebcdaf */ import java.io.*; import java.util.*; public class VowelReverse { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); String vowels = ""; String ans = ""; int arr[] = new int[str.length()]; for(int i=0;i<str.length();i++) { if(str.charAt(i)=='a' || str.charAt(i)=='e' || str.charAt(i)=='i' || str.charAt(i)=='o' || str.charAt(i)=='u') { vowels+=str.charAt(i); arr[i]=1; } } String revVowels = new StringBuffer(vowels).reverse().toString(); int j=0; for(int i=0;i<str.length();i++) { if(arr[i]!=1) { ans+=str.charAt(i); } else { ans+=revVowels.charAt(j); j++; } } System.out.println(ans); } }