Under Linux installation configuration Hadoop2.7.6


Premise
installation jdk

Download
wget http://mirrors.hust.edu.cn/apache/hadoop/common/hadoop-2.7.6/hadoop-2.7.6.tar.gz

Decompression

Configuration

vim /etc/profile

# Set java environment variables
Export JAVA_HOME = / opt / jdk1.8.0_162
Export the PATH = $ the PATH: $ JAVA_HOME / bin

# Hadoop configuration environment variable
Export HADOOP_HOME = / usr / local / src / hadoop-2.7.6
Export the PATH = $ the PATH: $ HADOOP_HOME / bin
Export the PATH = $ the PATH: $ HADOOP_HOME / sbin

Reload the file
source / etc / profile


[root@localhost hadoop-2.7.6]# hadoop version
Hadoop 2.7.6
Subversion https://[email protected]/repos/asf/hadoop.git -r 085099c66cf28be31604560c376fa282e69282b8
Compiled by kshvachk on 2018-04-18T01:33Z
Compiled with protoc 2.5.0
From source with checksum 71e2695531cb3360ab74598755d036
This command was run using /usr/local/src/hadoop-2.7.6/share/hadoop/common/hadoop-common-2.7.6.jar

vim etc/hadoop/hadoop-env.sh

The
export JAVA_HOME = $ {JAVA_HOME}
to
export JAVA_HOME = / opt / jdk1.8.0_162


hadoop official case
http://hadoop.apache.org/docs/r2.7.6/hadoop-project-dist/hadoop-common/SingleCluster.html

mkdir input
cp etc/hadoop/*.xml input
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.6.jar grep input output 'dfs[a-z.]+'
cat output/*


hadoop official Case 2
mkdir wcinput
cd wcinput
vim wc.input

hello hello
world
go
java java
c c c
hadoop

cd ..
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.6.jar wordcount wcinput wcoutput
cat wcoutput/*

Reproduced in: https: //my.oschina.net/mengzhang6/blog/1831772

Guess you like

Origin blog.csdn.net/weixin_34077371/article/details/92482929