Hadoop多个dfs目录中有一个磁盘空间超过90%解决(used space above threshold of 90.0%)

 异常信息

1/1 local-dirs usable space is below configured utilization percentage/no more usable space [ /data/hadoop/tmp/data/nm-local-dir : used space above threshold of 90.0% ] ; 1/1 log-dirs usable space is below configured utilization percentage/no more usable space [ /data/hadoop/logs/userlogs : used space above threshold of 90.0% ]

由Hadoop的web管理端可以看到是因为磁盘使用率超过90%,产生的不健康节点

查看hdfs管理控制台看到node3的存储使用了42%,

进入node3节点,使用df -h查看磁盘使用情况,发现hdfs-site.xml配置的dfs.datanode.data.dir的一个目录磁盘确实使用达到90%

解决办法:

第一步
使用命令:hdfs diskbalancer -plan 节点名称

我是node3节点需要平衡,所以我使用:hdfs diskbalancer -plan node3

命令执行完毕以后会生成一个xxxx/节点名称.plan.json的文件

[bigdata@master ~]$ hdfs diskbalancer -plan node3
2020-10-19 18:07:40,599 INFO planner.GreedyPlanner: Starting plan for Node : node3:9867
2020-10-19 18:07:40,601 INFO planner.GreedyPlanner: Disk Volume set fa9cbf3c-61f4-434f-be30-7a9736922c32 Type : DISK plan completed.
2020-10-19 18:07:40,602 INFO planner.GreedyPlanner: Compute Plan for Node : node3:9867 took 20 ms 
2020-10-19 18:07:40,602 INFO command.Command: Writing plan to:
2020-10-19 18:07:40,602 INFO command.Command: /system/diskbalancer/2020-十月-19-18-07-40/node3.plan.json
Writing plan to:
/system/diskbalancer/2020-十月-19-18-07-40/node3.plan.json

第二步:

根据第一步生成的json文件,我生成的json名称为:/system/diskbalancer/2020-十月-19-18-07-40/node3.plan.json

执行命令:hdfs diskbalancer -execute   xxxx.json

根据我生成文件,所以我执行的命令是: hdfs diskbalancer -execute  /system/diskbalancer/2020-十月-19-18-07-40/node3.plan.json

[bigdata@master ~]$ hdfs diskbalancer -execute /system/diskbalancer/2020-十月-19-18-07-40/node3.plan.json
2020-10-19 18:08:03,451 INFO command.Command: Executing "execute plan" command

第三步查询执行结果

执行命令:hdfs diskbalancer -query 节点名称

我平衡的是node3,所以我的命令是:hdfs diskbalancer -query node3

看到PLAN_UNDER_PROGRESS 表示正在平衡,

PLAN_DONE 表示完成

 

[bigdata@master ~]$ hdfs diskbalancer -query node3
2020-10-19 18:08:45,869 INFO command.Command: Executing "query plan" command.
Plan File: /system/diskbalancer/2020-十月-19-18-07-40/node3.plan.json
Plan ID: 4bebf9380c5209f7909cd2e978ea591193ee398c
Result: PLAN_UNDER_PROGRESS

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值