每日总结

hadoop102安装Hadoop

Hadoop下载地址https://archive.apache.org/dist/hadoop/common/hadoop-3.1.3/

1XShell文件传输工具将hadoop-3.1.3.tar.gz导入到opt目录下面的software文件夹下面

2进入到Hadoop安装包路径下

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

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

[atguigu@hadoop10software]$ tar -zxvf hadoop-3.1.3.tar.gz -C /opt/module/

4查看是否解压成功

[atguigu@hadoop10software]$ ls /opt/module/

hadoop-3.1.3

5Hadoop添加到环境变量

1)获取Hadoop安装路径

[atguigu@hadoop10hadoop-3.1.3]$ pwd

/opt/module/hadoop-3.1.3

2)打开/etc/profile.d/my_env.sh文件

[atguigu@hadoop10hadoop-3.1.3]$ sudo vi/etc/profile.d/my_env.sh

  • my_env.sh文件末尾添加如下内容:(shift+g

#HADOOP_HOME

export HADOOP_HOME=/opt/module/hadoop-3.1.3

export PATH=$PATH:$HADOOP_HOME/bin

export PATH=$PATH:$HADOOP_HOME/sbin

  • 保存并退出: :wq

3)让修改后的文件生效

[atguigu@hadoop10hadoop-3.1.3]$ source /etc/profile

6)测试是否安装成功

[atguigu@hadoop10hadoop-3.1.3]$ hadoop version

Hadoop 3.1.3

7重启如果Hadoop命令不能用再重启虚拟机)

[atguigu@hadoop10hadoop-3.1.3]$ sudo reboot

posted @ 2021-10-05 16:11  小萌新一枚lll  阅读(23)  评论(0编辑  收藏  举报