hadoop-hdfs-完全分布式搭建 随笔 第1张

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 

hadoop-hdfs-完全分布式搭建 随笔 第2张

 

 给其余三台安装JDK:

hadoop-hdfs-完全分布式搭建 随笔 第3张

 

 安装的历史步骤,查看自己执行过的命令:具体安装步骤:https://www.cnblogs.com/LXL616/p/10810738.htmlhadoop-hdfs-完全分布式搭建 随笔 第4张

 

配置环境变量:

 

export JAVA_HOME=/usr/java/jdk1.8.0_152
export HADOOP_HOME=/opt/sxt/hadoop-2.7.2
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

 hadoop-hdfs-完全分布式搭建 随笔 第5张

hadoop-hdfs-完全分布式搭建 随笔 第6张

 hadoop-hdfs-完全分布式搭建 随笔 第7张

hadoop-hdfs-完全分布式搭建 随笔 第8张

 

 

 免秘钥:(管理脚本访问其他节点做的免秘钥):

hadoop-hdfs-完全分布式搭建 随笔 第9张

 

 hadoop-hdfs-完全分布式搭建 随笔 第10张

 

 hadoop-hdfs-完全分布式搭建 随笔 第11张

hadoop-hdfs-完全分布式搭建 随笔 第12张

 

 hadoop-hdfs-完全分布式搭建 随笔 第13张

 记得最后都要执行 exit 退出连接

 

 

 

hadoop-hdfs-完全分布式搭建 随笔 第14张

 

 hadoop-hdfs-完全分布式搭建 随笔 第15张

 

 hadoop-hdfs-完全分布式搭建 随笔 第16张

 

 对其他两台进行相同的操作:

hadoop-hdfs-完全分布式搭建 随笔 第17张

 

 hadoop-hdfs-完全分布式搭建 随笔 第18张

 hadoop-hdfs-完全分布式搭建 随笔 第19张

 

 hadoop-hdfs-完全分布式搭建 随笔 第20张

 

设置四台虚拟机时间保证时间相同:

hadoop-hdfs-完全分布式搭建 随笔 第21张

hadoop-hdfs-完全分布式搭建 随笔 第22张

 

 我这边时间不一致所以要统一设置时间

 hadoop-hdfs-完全分布式搭建 随笔 第23张

 这样四台显示的时间就一样了

 hadoop-hdfs-完全分布式搭建 随笔 第24张

hadoop-hdfs-完全分布式搭建 随笔 第25张

hadoop-hdfs-完全分布式搭建 随笔 第26张

hadoop-hdfs-完全分布式搭建 随笔 第27张

 

接下来部署Hadoop:

 

 先将四台虚拟机都创建一个为Hadoop安装准备的目录

hadoop-hdfs-完全分布式搭建 随笔 第28张

 

 hadoop-hdfs-完全分布式搭建 随笔 第29张

 

进到配置文件目录:然后把上次的伪分布式的文件修改成完全分布式

hadoop-hdfs-完全分布式搭建 随笔 第30张

 

规划namenode 的启动位置

core-site.xml 文件设置可以决定namenode 在哪里启动

 hadoop-hdfs-完全分布式搭建 随笔 第31张

hadoop-hdfs-完全分布式搭建 随笔 第32张

hadoop-hdfs-完全分布式搭建 随笔 第33张

 

 规划datanode 的启动位置

 slaves 文件规划datanode 的启动位置

 hadoop-hdfs-完全分布式搭建 随笔 第34张

hadoop-hdfs-完全分布式搭建 随笔 第35张

 

 

 规划secondnamenode 的启动位置

 hdfs-site.xml 文件规划secondnamenode 的启动位置

 hadoop-hdfs-完全分布式搭建 随笔 第36张

 hadoop-hdfs-完全分布式搭建 随笔 第37张

 

 由于昨天已经搭建过伪分布式文件系统 这边 env 的Java路径就不需要修改了

 

 

分发hadoop文件目录

 hadoop-hdfs-完全分布式搭建 随笔 第38张

 

hadoop-hdfs-完全分布式搭建 随笔 第39张

 

 给其他两台同样的方式拷贝Hadoop目录

 

 hadoop-hdfs-完全分布式搭建 随笔 第40张

 

 

格式化完全分布式文件系统

hadoop-hdfs-完全分布式搭建 随笔 第41张

 

 hadoop-hdfs-完全分布式搭建 随笔 第42张

 

 hadoop-hdfs-完全分布式搭建 随笔 第43张

这边dfs下只有name文件说明这里只有namenode

 

 启动分布式文件系统

 

node01:

hadoop-hdfs-完全分布式搭建 随笔 第44张

 

 node02:

 hadoop-hdfs-完全分布式搭建 随笔 第45张

 

 node03 node04

 hadoop-hdfs-完全分布式搭建 随笔 第46张

 

 

 

 

 

图形化界面

hadoop-hdfs-完全分布式搭建 随笔 第47张

 

 

 hadoop-hdfs-完全分布式搭建 随笔 第48张

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄