hadoop安装使用,centos7

2018-12-07 00:21 
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/c5113620/article/details/84816813

yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel   安装openjdk
wget http://apache.mirrors.pair.com/hadoop/common/hadoop-2.7.6/hadoop-2.7.6.tar.gz
tar -xzf hadoop-2.7.6.tar.gz

vi .bashrc    设置环境变量
  export JAVA_HOME=/usr/lib/jvm/java
  export PATH=$JAVA_HOME/bin:${PATH}
  export PATH=/root/hadoop-2.7.6/bin:${PATH}  

检查java与hadoop
echo $JAVA_HOME
which java
which hadoop

测试hadoop
mkdir hadoop
cd hadoop
cp /root/hadoop-2.7.6/etc/hadoop/*.xml .
hadoop jar ~/hadoop-2.7.6/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.6.jar grep . ./output 'principal[.]*'
cat cat output/*
  6	principal
  1	principal.

发表评论

您必须 登录 才能发表留言!