Hadoop的安装,环境变量的配置

一、进入到Hadoop安装包路径下

[victor@node1 ~]$ cd /opt/software/
[victor@node1 software]$ pwd
/opt/software

二、解压安装文件到/opt/module下面

[victor@node1 software]$ tar -xzvf hadoop-2.8.2.tar.gz -C /opt/module/

如果出现解压后文件的用户组不是当前用户,使用下面命令

[victor@node1 software]# tar --no-same-owner -xzvf hadoop-2.8.2.tar.gz -C /opt/module/

三、查看是否解压成功

[victor@node1 software]$ ls /opt/module/hadoop-2.8.2

四、将hadoop添加到环境变量

1、获取hadoop安装路径

[victor@node1 ~]$ cd /opt/module/hadoop-2.8.2/
[victor@node1 hadoop-2.8.2]$ pwd
/opt/module/hadoop-2.8.2

2、编辑 /etc/profile 文件

[victor@node1 ~]$ sudo vim /etc/profile

##JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_144
export PATH=$PATH:$JAVA_HOME/bin

##HADOOP_HOME
export HADOOP_HOME=/opt/module/hadoop-2.8.2
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin

:wq

3、让修改后的文件生效

[victor@node1 ~]$ source /etc/profile
[victor@node1 ~]$ hadoop version
Hadoop 2.8.2
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 
66c47f2a01ad9637879e95f80c41f798373828fb
Compiled by jdu on 2017-10-19T20:39Z
Compiled with protoc 2.5.0
From source with checksum dce55e5afe30c210816b39b631a53b1d
This command was run using /opt/module/hadoop-2.8.2/share/hadoop/common/hadoop-common-2.8.2.jar
©️2020 CSDN 皮肤主题: 1024 设计师:上身试试 返回首页