You are on page 1of 4

download links for java n hadoop

https://www.oracle.com/in/java/technologies/javase/javase-jdk8-downloads.html

https://archive.apache.org/dist/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz

skip above commands

==============================================================
$ sudo apt-get update

$ sudo apt-get install openssh-server

$ ifconfig
eth1
inet 192.168.56.101 will show ip address of machine note down for further
process.

$ sudo nano /etc/network/interfaces

and type this by erassing all


# interfaces(5) file used by ifup(8) and ifdown(8)

auto lo
iface lo inet loopback
auto eth1

iface eth1 inet static


address 192.168.56.101
netmask 255.255.255.0

to save ctrl+x y enter

change hostname by

$ sudo nano /etc/hostname


masternode

ctrl+x y enter

$ sudo nano /etc/hosts


and type this
127.0.0.1 localhost
192.168.56.101 masternode

# The following lines are desirable for IPv6 capable hosts


::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

$ ssh-keygen

$ ssh localhost

$ ssh-copy-id -i localhost
check and run

$ ssh localhost

$ ssh-copy-id -i masternode (name of host)

$ ssh-copy-id -i masternode

$ ssh masternode

& sudo init 6

==========================================================

unzip tar files

$ cd Downloads

home%masternode ~/Downloads $

$ tar zxf jdk-8u251-linux-i586.tar.gz

$ sudo mkdir -p /usr/lib/jvm

$ sudo mv jdk1.8.0_251 /usr/lib/jvm/jdk1.8.0_251

$ sudo update-alternatives --install "/usr/bin/java" "java"


"/usr/lib/jvm/jdk1.8.0_251/bin/java" 1

$ sudo update-alternatives --install "/usr/bin/javac" "javac"


"/usr/lib/jvm/jdk1.8.0_251/bin/javac" 1

$ sudo update-alternatives --install "/usr/bin/javaws" "javaws"


"/usr/lib/jvm/jdk1.8.0_251/bin/javaws" 1

$ sudo chmod a+x /usr/bin/java


$ sudo chmod a+x /usr/bin/javac
$ sudo chmod a+x /usr/bin/javaws
$ sudo chown -R root:root /usr/lib/jvm/jdk1.8.0_251

$ tar -xzvf hadoop-2.6.0.tar.gz

in .bashrc file type following code


$ gedit ~/.bashrc
# then copy past these lines at end of file then save & close

export HADOOP_PREFIX="/opt/hadoop-2.6.0/"
export PATH=$PATH:$HADOOP_PREFIX/bin
export PATH=$PATH:$HADOOP_PREFIX/sbin
export HADOOP_COMMON_HOME=${HADOOP_PREFIX}
export HADOOP_MAPRED_HOME=${HADOOP_PREFIX}
export HADOOP_HDFS_HOME=${HADOOP_PREFIX}
export YARN_HOME=${HADOOP_PREFIX}
export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_251/"
export PATH=$PATH:$JAVA_HOME/bin
now move to hadoop/etc/hadoop folder

Hadoop-env.sh

# The java implementation to use.


export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_251/"

core-site.xml

<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:8020</value>
<final>true</final>
</property>
</configuration>

hdfs-site.xml

<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>

<property>
<name>dfs.namenode.name.dir</name>
<value>file:///opt/hadoop-2.6.0/hadoop_data/dfs/name</value>
</property>

<property>
<name>dfs.blocksize</name>
<value>268435456</value>
</property>

<property>
<name>dfs.datanode.data.dir</name>
<value>file:///opt/hadoop-2.6.0/hadoop_data/dfs/data</value>
</property>
</configuration>

mapreduce-site.xml

<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>

yarn-site.xml this configuration

<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>

$ sudo mv hadoop-2.6.0 /opt/hadoop-2.6.0


$ cd ~
$ source ~/.bashrc

$ execstack -c /opt/hadoop-2.6.0/lib/native/libhdfs.so.0.0.0

$ hdfs namenode -format (this command should be applied only ones at first time,
unless it will remove all data in namenode)

$ start-dfs.sh or $ start-all.sh
$ start-yarn.sh

$ jps press enter


3729 Jps
3305 ResourceManager
3147 SecondaryNameNode
2959 DataNode
3439 NodeManager
2342 NameNode

To fix this annoying warning, update your hadoop-env.sh file under etc/hadoop, and
replace following line

# Extra Java runtime options. Empty by default.


export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"

with the following line, by adding -XX:-PrintWarnings

# Extra Java runtime options. Empty by default.


export HADOOP_OPTS="$HADOOP_OPTS -XX:-PrintWarnings
-Djava.net.preferIPv4Stack=true"

You might also like