大数据-Hadoop安装
阅读原文时间:2023年07月09日阅读:1
  1. 进入到Hadoop安装包路径下

[atguigu@hadoop101 ~]$ cd /opt/software/

  1. 解压安装文件到/opt/module下面

[atguigu@hadoop101 software]$ tar -zxvf hadoop-2.7.2.tar.gz -C /opt/module/

  1. 查看是否解压成功

[atguigu@hadoop101 software]$ ls /opt/module/

hadoop-2.7.2

5. 将Hadoop添加到环境变量

(1)获取Hadoop安装路径

[atguigu@hadoop101 hadoop-2.7.2]$ pwd

/opt/module/hadoop-2.7.2

(2)打开/etc/profile文件

[atguigu@hadoop101 hadoop-2.7.2]$ sudo vi /etc/profile

在profile文件末尾添加JDK路径:(shitf+g)

##HADOOP_HOME

export HADOOP_HOME=/opt/module/hadoop-2.7.2

export PATH=$PATH:$HADOOP_HOME/bin

export PATH=$PATH:$HADOOP_HOME/sbin

(3)保存后退出

:wq

(4)让修改后的文件生效

[atguigu@ hadoop101 hadoop-2.7.2]$ source /etc/profile

6. 测试是否安装成功

[atguigu@hadoop101 hadoop-2.7.2]$ hadoop version

Hadoop 2.7.2

7. 重启(如果Hadoop命令不能用再重启)

[atguigu@ hadoop101 hadoop-2.7.2]$ sync

[atguigu@ hadoop101 hadoop-2.7.2]$ sudo reboot