1、目录配额
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hadoop fs -lsr /
lsr: DEPRECATED: Please use 'ls -R' instead.
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:50 /user
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:50 /user/xiaoqiu
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:50 /user/xiaoqiu/data
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:44 /usr
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:44 /usr/xiaoqiu
drwxr-xr-x - xiaoqiu supergroup 0 2017-12-29 15:44 /usr/xiaoqiu/hadoop
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfsadmin -setQuota 1 data
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -mkdir -p data/a
mkdir: The NameSpace quota (directories and files) of directory /user/xiaoqiu/data is exceeded: quota=1 file count=2
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfsadmin -setQuota 3 data
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -mkdir -p data/a
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -mkdir -p data/a/b
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -mkdir -p data/a/b/c
mkdir: The NameSpace quota (directories and files) of directory /user/xiaoqiu/data is exceeded: quota=3 file count=4
2、设置空间配额
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -mkdir -p data2
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfsadmin -setSpaceQuota 5 data2
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ echo how > a.txt
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfs -put a.txt data2
3、清除配额
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfsadmin -clrQuota data
[xiaoqiu@s150 /home/xiaoqiu/hadoop_tmp]$ hdfs dfsadmin -clrQuota data2
欢迎关注我的公众号:小秋的博客
CSDN博客:https://blog.csdn.net/xiaoqiu_cr
github:https://github.com/crr121
联系邮箱:rongchen633@gmail.com
有什么问题可以给我留言噢~