HDFS QUOTAS

 There  are two quotas in hdfs,

  1.  Space Quota - will set maximum space for directory

  2. normal Quota - will no of file can stored in directory

Hadoop HDFS Space Quota cmd:

to set sapce quota : hadoop dfsadmin -setSpaceQuota <quota-size> /<foldername> or hdfs dfsadmin -setSpaceQuota <quota-size> <directory-path>

to clear space quota : hadoop dfs -clrSpaceQuota /<foldername>

practical example :-
In below example, i'm trying to move LICENSE.txt to /mr_output folder after space quota set. mr_output already contains 2 files


use : hadoop fs -count -q -h -v /<foldername>
to check quota information for that directory.

In below, 
i set space quota to 500B(byte) and tried to move license file to folder.
It throwed quota error.
Then i cleared space quota 




Hadoop HDFS Quota cmds:

to set quota : hadoop dfsadmin -setQuota <file-count> /<foldername> or hdfs dfsadmin -setQuota <file-count> <directory-path>
to clear : hadoop dfs -clrSpaceQuota /<foldername>

example:


in above, initial file count of mr_output was 2 + 1 for mr_output . so, total 3. i set quota to 4 and moved one file to mr_output. quota full. again tried then got quota error.


cmd to check quota
hadoop fs -count -q -h -v /<foldername>

fs cmds
move file : hadoop fs -put <frompathwithfilename> <topathwithfilename> 
list files and folders  : hadoop fs -ls / or /<foldername>


when do update on Hive table,
will create new file with updated data and update filename in meta mapping. but old file still there in hdfs. to clear that  use hive compaction. we should not use frequently but in specific interval to remove old files.

Comments

Popular posts from this blog

INTRODUCTION HADOOP

Hadoop Single Node installation Guide Ubuntu