815每周总结

现在已经有了三台主机,接下来就是配置虚拟机了。首先是JDK的安装:

在 在 hadoop102 装 安装 JDK
1 )有 卸载现有 JDK
注意:安装 JDK 前,一定确保提前删除了虚拟机自带的 JDK。详细步骤见问文档 3.1 节
中卸载 JDK 步骤。
2 )用 用 XShell 传输 工具将 JDK 导入到 opt 目录下面的 software 文件夹下面

3 )在 在 Linux 系统下的 opt 目录中查看软件包是否导入成功
[atguigu@hadoop102 ~]$ ls /opt/software/
看到如下结果:
jdk-8u212-linux-x64.tar.gz
4 ) 解压 JDK 到/opt/module 目录下
[atguigu@hadoop102 software]$ tar -zxvf jdk-8u212-linux-
x64.tar.gz -C /opt/module/
5 ) 配置 JDK 环境变量
(1)新建/etc/profile.d/my_env.sh 文件
[atguigu@hadoop102 ~]$ sudo vim /etc/profile.d/my_env.sh
添加如下内容
#JAVA_HOME
export JAVA_HOME=/opt/module/jdk1.8.0_212
export PATH=$PATH:$JAVA_HOME/bin
(2)保存后退出
:wq
(3)source 一下/etc/profile 文件,让新的环境变量 PATH 生效
[atguigu@hadoop102 ~]$ source /etc/profile
6 ) 测试 JDK 是否 安装成功
[atguigu@hadoop102 ~]$ java -version
如果能看到以下结果,则代表 Java 安装成功。
java version "1.8.0_212"

注意:重启(如果 java -version 可以用就不用重启)
[atguigu@hadoop102 ~]$ sudo reboot

然后在hadoop102安装hadoop:

Hadoop 下载地址:https://archive.apache.org/dist/hadoop/common/hadoop-3.1.3/
1 )用 用 XShell 文件传输 工具将 hadoop-3.1.3.tar.gz 导入到 opt 目录下面的 software 文件夹下

2 ) 进入到 Hadoop 安装包路径下
[atguigu@hadoop102 ~]$ cd /opt/software/
3 ) 解压安装文件到/opt/module 下面
[atguigu@hadoop102 software]$ tar -zxvf hadoop-3.1.3.tar.gz -C
/opt/module/
4 ) 查看是否解压成功
[atguigu@hadoop102 software]$ ls /opt/module/
hadoop-3.1.3
5 )将 将 Hadoop 添加到环境变量
(1)获取 Hadoop 安装路径
[atguigu@hadoop102 hadoop-3.1.3]$ pwd
/opt/module/hadoop-3.1.3
(2)打开/etc/profile.d/my_env.sh 文件
[atguigu@hadoop102 hadoop-3.1.3]$ sudo vim
/etc/profile.d/my_env.sh

2 ) 进入到 Hadoop 安装包路径下
[atguigu@hadoop102 ~]$ cd /opt/software/
3 ) 解压安装文件到/opt/module 下面
[atguigu@hadoop102 software]$ tar -zxvf hadoop-3.1.3.tar.gz -C
/opt/module/
4 ) 查看是否解压成功
[atguigu@hadoop102 software]$ ls /opt/module/
hadoop-3.1.3
5 )将 将 Hadoop 添加到环境变量
(1)获取 Hadoop 安装路径
[atguigu@hadoop102 hadoop-3.1.3]$ pwd
/opt/module/hadoop-3.1.3
(2)打开/etc/profile.d/my_env.sh 文件
[atguigu@hadoop102 hadoop-3.1.3]$ sudo vim
/etc/profile.d/my_env.sh

1 ) 查看 Hadoop 目录结构
[atguigu@hadoop102 hadoop-3.1.3]$ ll
总用量 52
drwxr-xr-x. 2 atguigu atguigu 4096 5 月 22 2017 bin
drwxr-xr-x. 3 atguigu atguigu 4096 5 月 22 2017 etc
drwxr-xr-x. 2 atguigu atguigu 4096 5 月 22 2017 include
drwxr-xr-x. 3 atguigu atguigu 4096 5 月 22 2017 lib
drwxr-xr-x. 2 atguigu atguigu 4096 5 月 22 2017 libexec
-rw-r--r--. 1 atguigu atguigu 15429 5 月 22 2017 LICENSE.txt
-rw-r--r--. 1 atguigu atguigu 101 5 月 22 2017 NOTICE.txt
-rw-r--r--. 1 atguigu atguigu 1366 5 月 22 2017 README.txt
drwxr-xr-x. 2 atguigu atguigu 4096 5 月 22 2017 sbin
drwxr-xr-x. 4 atguigu atguigu 4096 5 月 22 2017 share
2 ) 重要目录
(1)bin 目录:存放对 Hadoop 相关服务(hdfs,yarn,mapred)进行操作的脚本
(2)etc 目录:Hadoop 的配置文件目录,存放 Hadoop 的配置文件
(3)lib 目录:存放 Hadoop 的本地库(对数据进行压缩解压缩功能)
(4)sbin 目录:存放启动或停止 Hadoop 相关服务的脚本
(5)share 目录:存放 Hadoop 的依赖 jar 包、文档、和官方案例

原文地址:https://www.cnblogs.com/ruangongwangxiansheng/p/14161466.html