<
>

ol7.7安装部署4节点hadoop 3.2.1分布式集群学习环境的详细教程

2020-07-10 14:01:02 来源:易采站长站 作者:于海丽

修改yarn-site.xml

<configuration>
 <property>
  <name>yarn.resourcemanager.hostname</name>
  <value>master</value>
 </property>
 <property>
  <name>yarn.nodemanager.aux-services</name>
  <value>mapreduce_shuffle</value>
 </property>
</configuration>

修改hadoop-env.sh找到JAVA_HOME的配置将目录修改为

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_191

修改workers

[hadoop@master /usr/local/hadoop/etc/hadoop]$ vim workers
master
slave1
slave2
slave3

最后将配置好的/usr/local/hadoop文件夹复制到其他节点

sudo scp -r /usr/local/hadoop/ slave1:/usr/local/
sudo scp -r /usr/local/hadoop/ slave2:/usr/local/
sudo scp -r /usr/local/hadoop/ slave3:/usr/local/

并且把文件夹owner改为hadoop

sudo systemctl stop firewalld
sudo systemctl disable firewalld

关闭防火墙

格式化hdfs,首次运行前运行,以后不用,在任意节点执行都可以/usr/local/hadoop/bin/hadoop namenode –format

看到这个successfuly formatted就是表示成功

start-dfs.sh启动集群hdfs

jps命令查看运行情况

通过master的9870端口可以网页监控http://192.168.168.11:9870/

也可以通过命令行查看集群状态hadoop dfsadmin -report

[hadoop@master ~]$ hadoop dfsadmin -report
WARNING: Use of this script to execute dfsadmin is deprecated.
WARNING: Attempting to execute replacement "hdfs dfsadmin" instead.
 
Configured Capacity: 201731358720 (187.88 GB)
Present Capacity: 162921230336 (151.73 GB)
DFS Remaining: 162921181184 (151.73 GB)
DFS Used: 49152 (48 KB)
DFS Used%: 0.00%
Replicated Blocks:
 Under replicated blocks: 0
 Blocks with corrupt replicas: 0
 Missing blocks: 0
 Missing blocks (with replication factor 1): 0
 Low redundancy blocks with highest priority to recover: 0
 Pending deletion blocks: 0
Erasure Coded Block Groups:
 Low redundancy block groups: 0
 Block groups with corrupt internal blocks: 0
 Missing block groups: 0
 Low redundancy blocks with highest priority to recover: 0
 Pending deletion blocks: 0
 
-------------------------------------------------
Live datanodes (4):
 
Name: 192.168.168.11:9866 (master)
Hostname: master
Decommission Status : Normal
Configured Capacity: 50432839680 (46.97 GB)
DFS Used: 12288 (12 KB)
Non DFS Used: 9796546560 (9.12 GB)
DFS Remaining: 40636280832 (37.85 GB)
DFS Used%: 0.00%
DFS Remaining%: 80.58%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Fri Jul 03 11:14:44 CST 2020
Last Block Report: Fri Jul 03 11:10:35 CST 2020
Num of Blocks: 0
 
 
Name: 192.168.168.12:9866 (slave1)
Hostname: slave1
Decommission Status : Normal
Configured Capacity: 50432839680 (46.97 GB)
DFS Used: 12288 (12 KB)
Non DFS Used: 9710411776 (9.04 GB)
DFS Remaining: 40722415616 (37.93 GB)
DFS Used%: 0.00%
DFS Remaining%: 80.75%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Fri Jul 03 11:14:44 CST 2020
Last Block Report: Fri Jul 03 11:10:35 CST 2020
Num of Blocks: 0
 
 
Name: 192.168.168.13:9866 (slave2)
Hostname: slave2
Decommission Status : Normal
Configured Capacity: 50432839680 (46.97 GB)
DFS Used: 12288 (12 KB)
Non DFS Used: 9657286656 (8.99 GB)
DFS Remaining: 40775540736 (37.98 GB)
DFS Used%: 0.00%
DFS Remaining%: 80.85%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Fri Jul 03 11:14:44 CST 2020
Last Block Report: Fri Jul 03 11:10:35 CST 2020
Num of Blocks: 0
 
 
Name: 192.168.168.14:9866 (slave3)
Hostname: slave3
Decommission Status : Normal
Configured Capacity: 50432839680 (46.97 GB)
DFS Used: 12288 (12 KB)
Non DFS Used: 9645883392 (8.98 GB)
DFS Remaining: 40786944000 (37.99 GB)
DFS Used%: 0.00%
DFS Remaining%: 80.87%
Configured Cache Capacity: 0 (0 B)
Cache Used: 0 (0 B)
Cache Remaining: 0 (0 B)
Cache Used%: 100.00%
Cache Remaining%: 0.00%
Xceivers: 1
Last contact: Fri Jul 03 11:14:44 CST 2020
Last Block Report: Fri Jul 03 11:10:35 CST 2020
Num of Blocks: 0
 
 
[hadoop@master ~]$
              
暂时禁止评论

微信扫一扫

易采站长站微信账号