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 有什么问题可以给我留言噢~
  • 相关阅读:
    android 自定义动画4 RotateAnimation源码分析
    Android 绘图 阴影制作(Shadow)
    view, surfaceView, invalidate, postInvalidate, 刷新屏幕
    android database 常用字段描述
    Android标题栏进度指示器使用
    ThumbnailUtils Android2.2新增类
    Android 重力感应 测试代码
    Android中内嵌字体实现个性化
    Android中悬浮窗口
    Android布局Java代码构造法
  • 原文地址:https://www.cnblogs.com/flyingcr/p/10327014.html
Copyright © 2011-2022 走看看