Hadoop Installation / Ubuntu 18.04 Environment
1. Installation Environment
The installation and execution environment is as follows.
- Ubuntu 18.04 LTS 64bit, root user
- Java openjdk version “1.8.0-171”
- Hadoop 3.0.3
2. sshd Installation, Configuration
$ apt update
$ apt install -y openssh-server
$ apt install -y pdshInstall sshd.
| |
Modify the /etc/ssh/sshd-config file with the contents of [File 1].
$ service sshd restart
$ ssh-keygen -t rsa -P '' -f ~/.ssh/id-rsa
$ cat ~/.ssh/id-rsa.pub >> ~/.ssh/authorized-keys
$ chmod 0600 ~/.ssh/authorized-keys
$ echo "ssh" > /etc/pdsh/rcmd-default
$ ssh localhost
...
Are you sure you want to continue connecting (yes/no)? yesRestart sshd and configure it so that a password is not required for ssh access.
3. Java Installation
$ apt update
$ apt install -y openjdk-8-jdkInstall the Java Package.
4. Hadoop Installation, Configuration
$ cd ~
$ wget http://mirror.navercorp.com/apache/hadoop/common/hadoop-3.0.3/hadoop-3.0.3.tar.gz
$ tar zxvf hadoop-3.0.3.tar.gzDownload the Hadoop Binary.
| |
Modify the ~/hadoop-3.0.3/etc/hadoop/hadoop-env.sh file as shown in [File 2].
| |
Modify the ~/hadoop-3.0.3/etc/hadoop/core-site.xml file as shown in [File 3].
| |
Modify the ~/hadoop-3.0.3/etc/hadoop/core-site.xml file as shown in [File 4].
| |
Add the contents of [File 5] to the ~/.bashrc file.
$ hdfs namenode -format
$ start-dfs.shFormat HDFS and start HDFS, then verify HDFS operation.
- Access http://localhost:9870 in a Web Browser.
5. YARN Installation, Configuration
$ cd ~/hadoop-3.0.
$ bin/hdfs dfs -mkdir /user
$ bin/hdfs dfs -mkdir /user/rootCreate a root user folder.
| |
Modify the ~/hadoop-3.0.3/etc/hadoop/mapred-site.xml file as shown in [File 6].
| |
Modify the ~/hadoop-3.0.3/etc/hadoop/yarn-site.xml file as shown in [File 7].
$ start-yarn.shStart YARN and verify YARN operation.
- http://localhost:8088
6. Operation Verification
$ jps
3988 NameNode
5707 Jps
5355 NodeManager
4203 DataNode
4492 SecondaryNameNode
5133 ResourceManagerVerify that 6 JVMs are running.
$ cd ~/hadoop-3.0.3
$ yarn jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.0.3.jar pi 16 1000
...
Estimated value of Pi is 3.14250000000000000000Run an Example.
7. Issue Resolution
$ stop-yarn.sh
$ stop-dfs.sh
$ rm -rf /tmp/*
$ start-dfs.sh
$ start-yarn.shIf a “There are 0 datanode(s)” Error occurs, perform the above steps.