您的位置 首页 大数据运维

hdfs 目录存储最大文件数异常 MaxDirectoryItemsExceededException

1. hdfs 目录存储最大文件数异常 MaxDirectoryItemsExceededException

问题描述

org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.hdfs.prot
ocol.FSLimitException$MaxDirectoryItemsExceededException): The
directory item limit of /XXX/XXX/FF is exceeded: limit=1048576
items=1048576
at
org.apache.hadoop.hdfs.server.namenode.FSDirectory.verifyMaxDirIte
ms(FSDirectory.java:2060)

解决办法

更改 hdfs-site.xml 添加如下

<property>
<name>dfs.namenode.fs-limits.max-directory-items</name>
<value>1048576</value>
<description>Defines the maximum number of items that a directory
may
contain. Cannot set the property to a value less than 1 or more
than
6400000.</description>
</property>

把这个配置添加到 hdfs-site.xml 中,把值设置为大一些,问题搞定。不过在此也存在一个问题,这个 HDFS 的限制有个范围,最多不能超过6400000,因此后续还要考虑到历史数据的删除

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章