linux配置Hadoop环境(jdk+hadoop)
程序员文章站
2024-03-12 12:09:32
...
linux配置Hadoop环境(jdk+hadoop)
安装指令
1.ORACLE官网下载jdk-1.7
mv jdk-7u80-linux-x64.tar.gz /opt
cd /opt
tar -zxvf jdk-7u80-linux-x64.tar.gz
// 根路径
cp -r jdk1.7.0_80/ /usr/bin/
//安装
update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_80/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_80/bin/javac 1
//配置
update-alternatives --set java /opt/jdk1.7.0_80/bin/java
update-alternatives --set javac /opt/jdk1.7.0_80/bin/javac
安装Hadoop:
下载相应版本的Hadoop,下面以Hadoop2.6.5为例
1.解压:
tar zxvf hadoop-2.6.5.tar.gz –C /opt
(2)Hadoop基本设置
打开hadoop路径中的 etc/hadoop/hadoop-env.sh中设置Java环境
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_71
(3)设置Hadoop环境变量
sudo leafpad/etc/profile
**加入**
export HADOOP_HOME=/opt/hadoop-2.6.5
export PATH=${HADOOP_HOME}/bin:$PATH