Snippets

Data Ottam just-3-clicks-to-install-your-apache-hadoop

Created by Data Ottam

File 3clicks.sh Added

  • Ignore whitespace
  • Hide word diff
+#! /bin/bash
+#sed -i -e 's/\r$//' scriptname.sh
+#sudo chmod 777 scriptname.sh
+#./scriptname.sh
+ sudo apt-get update \
+&& sudo apt-get -y install openssh-server \
+&& sudo apt-get -y install openjdk-7-jdk \
+&& sudo wget http://mirror.olnevhost.net/pub/apache/hadoop/common/hadoop-1.2.1/hadoop-1.2.1-bin.tar.gz \
+&& sudo tar -zxvf hadoop-1.2.1-bin.tar.gz \
+&& sudo mv hadoop-1.2.1 /home/ubuntu/hadoop \
+&& sudo chown -R ubuntu /home/ubuntu/hadoop \
+&& sudo echo "export HADOOP_HOME=/home/ubuntu/hadoop" >> /home/ubuntu/.bashrc \
+&& sudo echo "export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64/" >> /home/ubuntu/.bashrc \
+&& echo "export PATH=\$PATH:\$HADOOP_HOME/bin" >> /home/ubuntu/.bashrc \
+&& echo "export PATH=\$PATH:\$JAVA_HOME/bin" >> /home/ubuntu/.bashrc \
+&& sudo mkdir /home/ubuntu/hadoop/tmp \
+&& sudo chown root /home/ubuntu/hadoop/tmp \
+&& sudo chmod 777 /home/ubuntu/hadoop \
+&& sudo chmod 777 /home/ubuntu/hadoop/tmp \
+&& sudo sed -i 's/# export JAVA_HOME=\/usr\/lib\/j2sdk1.5-sun/export JAVA_HOME=\/usr\/lib\/jvm\/java-1.7.0-openjdk-amd64/' /home/ubuntu/hadoop/conf/hadoop-env.sh \
+&& sudo sed -i 's/# export HADOOP_OPTS=-server/export HADOOP_OPTS=-Djava.net.preferIPv4Stack=true/' /home/ubuntu/hadoop/conf/hadoop-env.sh \
+&& sudo sed -i "7d" /home/ubuntu/hadoop/conf/core-site.xml \
+&& sudo sed -i "7i<property>\n<name>fs.default.name</name>\n<value>hdfs://localhost:9000</value>\n</property>\n<property>\n<name>hadoop.tmp.dir</name>\n<value>/home/ubuntu/hadoop/tmp</value>\n</property>" /home/ubuntu/hadoop/conf/core-site.xml \
+&& sudo sed -i "7d" /home/ubuntu/hadoop/conf/mapred-site.xml \
+&& sudo sed -i "7i<property>\n<name>mapred.job.tracker</name>\n<value>localhost:9001</value>\n</property>" /home/ubuntu/hadoop/conf/mapred-site.xml \
+&& sudo sed -i "7d" /home/ubuntu/hadoop/conf/hdfs-site.xml \
+&& sudo sed -i "7i<property>\n<name>dfs.replication</name>\n<value>1</value>\n</property>" /home/ubuntu/hadoop/conf/hdfs-site.xml \
+&& ssh-keygen -b 2048 -t rsa -f /home/ubuntu/.ssh/id_rsa -q -N "" \
+&& cat /home/ubuntu/.ssh/id_rsa.pub >> /home/ubuntu/.ssh/authorized_keys \
+&& ssh-keyscan localhost >> /home/ubuntu/.ssh/known_hosts