HDFS QUOTAS
There are two quotas in hdfs,
- Space Quota - will set maximum space for directory
- 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
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:
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.
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
Post a Comment