【问题标题】:HDFS free space available commandHDFS 可用空间可用命令
【发布时间】:2020-11-24 22:38:21
【问题描述】:

是否有 hdfs 命令可以查看 hdfs 中的可用空间。我们可以通过浏览器中的 master:hdfsport 中的浏览器看到这一点,但由于某种原因,我无法访问它,我需要一些命令。 我可以通过命令 ./bin/hadoop fs -du -h 查看我的磁盘使用情况,但看不到可用空间。

感谢您提前回答。

【问题讨论】:

    标签: hadoop hdfs


    【解决方案1】:

    试试这个:

    hdfs dfsadmin -report
    

    使用旧版本的 Hadoop,试试这个:

    hadoop dfsadmin -report
    

    【讨论】:

    • 你也可以试试这个“hadoop fs -df -h”
    • 什么是dfs?什么是非dfs?
    • dfs used - hdfs 使用的空间,non-dfs used - hdfs 之外的磁盘使用情况。
    【解决方案2】:

    方法

    1。 dfsadmin

    在较新版本的 HDFS 中,dfsadmin 的 hadoop CLI 已弃用:

    $ sudo -u hdfs hadoop dfsadmin -report
    DEPRECATED: Use of this script to execute hdfs command is deprecated.
    Instead use the hdfs command for it.
    

    所以此时您应该只使用hdfs。此外,在需要sudo 的系统上,您可以像这样运行它:

    $ sudo -u hdfs hdfs dfsadmin -report
    
    2。 fs -df

    您还可以通过fs 模块对hadoop 使用其他方法:

    $ hadoop fs -df -h
    

    示例输出

    dfsadmin

    为了提供更全面的答案,这里是单节点安装的输出。

    $ sudo -u hdfs hdfs dfsadmin -report
    Configured Capacity: 7504658432 (6.99 GB)
    Present Capacity: 527142912 (502.72 MB)
    DFS Remaining: 36921344 (35.21 MB)
    DFS Used: 490221568 (467.51 MB)
    DFS Used%: 93.00%
    Under replicated blocks: 128
    Blocks with corrupt replicas: 0
    Missing blocks: 0
    Missing blocks (with replication factor 1): 0
    
    -------------------------------------------------
    Live datanodes (1):
    
    Name: 192.168.114.48:50010 (host-192-168-114-48.td.local)
    Hostname: host-192-168-114-48.td.local
    Decommission Status : Normal
    Configured Capacity: 7504658432 (6.99 GB)
    DFS Used: 490221568 (467.51 MB)
    Non DFS Used: 6977515520 (6.50 GB)
    DFS Remaining: 36921344 (35.21 MB)
    DFS Used%: 6.53%
    DFS Remaining%: 0.49%
    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: 2
    Last contact: Thu Feb 04 13:35:04 EST 2016
    

    在上述示例中,HDFS 硬盘空间已被 100% 使用。

    fs -df

    fs 模块中的-df 子命令相同的系统:

    $ hadoop fs -df -h
    Filesystem                                 Size     Used  Available  Use%
    hdfs://host-192-168-114-48.td.local:8020  7.0 G  467.5 M     18.3 M    7%
    

    【讨论】:

      【解决方案3】:

      Hadoop 版本 1:

      hadoop fs -df -h
      

      hadoop dfsadmin -report
      

      Hadoop 版本 2:

      hdfs dfs -df -h
      

      hadoop dfsadmin -report
      

      【讨论】:

        【解决方案4】:

        试试这个命令:

        hdfs dfsadmin -report
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-10-05
          • 1970-01-01
          • 2016-05-05
          • 1970-01-01
          • 2019-11-11
          • 1970-01-01
          相关资源
          最近更新 更多