Details of installation and configuration of hadoop2.7.2 under ubuntu15.10

  • 2020-12-22 17:55:06
  • OfStack

There are numerous installation tutorials for hadoop on the linux system on the Web and in many books, but even if you follow these tutorials step by step, you will still find that something goes wrong, mainly due to a version problem. In particular, the book version 1 is generally older, so it is not recommended to follow the book tutorial, but can be used as a reference. The following is my own personal practice of the installation process, as far as possible I know the principle also write out, so that even if some steps have problems, know the reason is also easy to solve, afraid of the problem, do not know where the problem?

The following code is entered in ubuntu's command window (terminal) :

1. Tool preparation:

1.1 Update apt-ES12en: Using ES13en-ES14en in the command line window is very convenient to install the software;


sudo apt-get update

1.2 Install vim: Configuration file.


sudo apt-get install vim

Depending on the output, you need to type "Y" to continue.

2. Create hadoop user:

2.1 Add hadoop users: Create hadoop users and use /bin/bash as shell


sudo useradd -m hadoop -s /bin/bash

2.2 Set the password and press the prompt to enter the password twice:


sudo passwd hadoop

2.3 Add administrator rights for hadoop users:


sudo adduser hadoop sudo

3. Install SSH and configure SSH to login without password

SSH login (similar to remote login, you can log in to an Linux host and run commands on it), Ubuntu has installed SSH client by default, and SSH server is also required:


sudo apt-get install openssh-server

After installation, you can log in the machine using the following command:


ssh localhost

Install the java environment

4.1 Installation of jdk:


sudo apt-get install openjdk-8-jre openjdk-8-jdk

4.2 configuration JAVA_HOME


dpkg -L openjdk-8-jdk | grep '/bin/javac'

The command outputs a path, removing the "/bin/javac" at the end of the path, leaving the correct path. Such as the output path for/usr lib/jvm/java - 8 - openjdk/bin/javac, we need the path of the as/usr lib/jvm/java - 8 - openjdk.

If the output is wrong, how do we know the address of JAVA_HOME? Very simple, type:


java -verbose

Output: usr/lib/jvm/java - 8 - openjdk/jre/lib/rt jar

The front usr/lib/jvm/java - 8 - openjdk is JAVA_HOME address.

Then, use the command sudo gedit /etc/profile to open the /etc/profile file:


sudo apt-get install vim
0

Then add the following three lines at the end of the file:


sudo apt-get install vim
1

ctrl+s is then saved. Then execute the following code to make the change take effect:


sudo apt-get install vim
2

If JAVA_HOME has not been changed, it is possible that the file has not taken effect and run


$source /etc/profile

Looking at JAVA_HOME again, you can see that this is the path we set in the file.

If the above setting is correct, $JAVA_HOME/bin/ java-ES143en will output the version information of java, just like the output result of ES145en-ES146en, as shown in the figure below, then the configuration is successful:

5. Install Hadoop

5.1 hadoop program download: http: / / mirror bit. edu. cn/apache/hadoop common /

Suggest that choose to download "stable" hadoop - 2. x. y. tar. gz.

5.2 hadoop installation

Input command:


sudo apt-get install vim
4

Hadoop is ready to use after decompression. Enter the following command to check if Hadoop is available, and Hadoop version information will be displayed if successful:


sudo apt-get install vim
5

5.3 hadoop click Configuration

The default mode of Hadoop is non-distributed and runs without additional configuration. Non-distributed or single Java process for easy debugging.

The configuration has not been completed yet. Due to the recent busy, The configuration will be reconfigured after two days.

conclusion


Related articles: