zoukankan      html  css  js  c++  java
  • HDFS设置配额管理

    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 有什么问题可以给我留言噢~
  • 相关阅读:
    C#运行Javascript脚本Utility
    SQL Mail XPs Options
    TSQL AVG Functions
    eclipse编译时过滤SVN版本控制信息方法(转)
    追MM与设计模式
    android的性能调优
    对象的赋值和复制(转)
    SVN Working Copy xxx locked and cleanup failed
    HTTP协议详解(转)
    atoi和itoa函数的实现
  • 原文地址:https://www.cnblogs.com/flyingcr/p/10327013.html
Copyright © 2011-2022 走看看