[toc]
搭建 Hadoop 环境
hadoop 从 1.x 到 2.x 有巨大的变化,如果大家是工作在 1.x 环境下,那么这个文档可能有些地方会不一定符适
下载安装
# 下载 Hadoop 安装包
# 在墙内,当然优选清华的源啦
wget http://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-2.8.0/hadoop-2.8.0.tar.gz
# 解压 Hadoop 安装包
tar xzf hadoop-2.8.0.tar.gz
mv hadoop-2.8.0 /usr/local/hadoop
tar zxf jdk-8u121-linux-x64.tar.gz
设置环境变量
nano /etc/profile
# set env by yong
export JAVA_HOME=/usr/local/jdk
export PATH="$PATH:$JAVA_HOME/bin"
# Set Hadoop-related environment variables
export HADOOP_HOME=/usr/local/hadoop
# Add Hadoop bin/ directory to PATH
export PATH="$PATH:$HADOOP_HOME/bin"
source /etc/profile
nano /usr/local/hadoop/etc/hadoop/hadoop-env.sh
查看 hadoop 版本 & 测试 hadoop 设置
hadoop version