2018-01-15 00:01:38 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-11-21 01:44:51 -05:00
|
|
|
# For Ubuntu 14.04
|
|
|
|
# Inspired from: https://github.com/curran/setupHadoop/blob/master/setupHadoop.sh
|
|
|
|
# Use from the user directory
|
|
|
|
|
|
|
|
# Install Java
|
|
|
|
sudo apt-get update
|
|
|
|
sudo add-apt-repository -y ppa:webupd8team/java
|
|
|
|
sudo apt-get install -y oracle-java8-installer
|
|
|
|
|
|
|
|
# Install Hadoop
|
|
|
|
curl -O http://mirror.cogentco.com/pub/apache/hadoop/common/hadoop-2.8.2/hadoop-2.8.2.tar.gz
|
|
|
|
tar xfz hadoop-2.8.2.tar.gz
|
|
|
|
sudo mv hadoop-2.8.2 /usr/local/hadoop
|
|
|
|
rm hadoop-2.8.2.tar.gz
|
|
|
|
|
|
|
|
# Environmental Variables
|
|
|
|
echo export JAVA_HOME=/usr/lib/jvm/java-8-oracle >> ~/.bashrc
|
|
|
|
echo export HADOOP_PREFIX=/usr/local/hadoop >> ~/.bashrc
|
|
|
|
echo export PATH=\$PATH:/usr/local/hadoop/bin >> ~/.bashrc
|
|
|
|
echo export PATH=\$PATH:/usr/local/hadoop/sbin >> ~/.bashrc
|
|
|
|
source ~/.bashrc
|
|
|
|
|
|
|
|
# Copy configuration files
|
|
|
|
cp master/* /usr/local/hadoop/etc/hadoop/
|
|
|
|
|
|
|
|
# Format HDFS
|
|
|
|
hdfs namenode -format
|
|
|
|
|
|
|
|
# SSH keys for Hadoop to use.
|
|
|
|
ssh-keygen -t rsa -P 'password' -f ~/.ssh/id_rsa.pub
|
|
|
|
sudo mv ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
|
|
|
|
|
|
|
|
# SSH
|
|
|
|
ssh localhost
|
2018-01-15 00:01:38 -05:00
|
|
|
# authenticate with osboxes.org
|
2017-11-21 01:44:51 -05:00
|
|
|
|
|
|
|
# Start NameNode daemon and DataNode daemon
|
|
|
|
start-dfs.sh
|
|
|
|
# stop-dfs.sh
|
|
|
|
|
|
|
|
# Install Maven
|
|
|
|
sudo apt-get install maven
|
2018-01-15 00:01:38 -05:00
|
|
|
|
|
|
|
# Access Hadoop - http://localhost:50070
|