hadoop - Deleting files from HDFS does not free up disk space -
after upgrading our small cloudera hadoop cluster cdh 5, deleting files no longer frees available storage space. though delete more data add, file system keeps filling up.
cluster setup
we running 4 node cluster on physical, dedicated hardware, 110 tb of total storage capacity. on april 3, upgraded cdh software 5.0.0-beta2 version version 5.0.0-1.
we used put log data on hdfs in plain text format @ rate of approximately 700 gb/day. on april 1 switched importing data .gz files instead, lowered daily ingestion rate 130 gb.
since want retain data age, there nightly job delete obsolete files. result of used visible in hdfs capacity monitoring chart, can no longer seen.
sine import 570 gb less data delete every day, 1 expect capacity used go down. instead our reported hdfs use has been growing since cluster software upgraded.
problem description
running hdfs hadoop fs -du -h /
gives following output:
0 /system 1.3 t /tmp 24.3 t /user
this consistent expect see, given size of imported files. using replication factor of 3, should correspond physical disk usage of 76.8 tb.
when instead running hdfs dfsadmin -report
result different:
configured capacity: 125179101388800 (113.85 tb) present capacity: 119134820995005 (108.35 tb) dfs remaining: 10020134191104 (9.11 tb) dfs used: 109114686803901 (99.24 tb) dfs used%: 91.59% under replicated blocks: 0 blocks corrupt replicas: 0 missing blocks: 0
here, dfs used reported 99.24 tb, see in monitoring chart. did data come from?
what have tried
the first thing suspected automatic emptying of trash not working, not seem case. deleted files in trash, , automatically disappear after day.
our issue seem similar happen if hdfs metadata upgrade performed not finalized. don't think needed when upgrading between these versions, have still performed both steps 'just in case'.
on dn storage volumes in local file system, there lot of data under `previous/finalized'. have little knowledge of implementation details of hdsf know if significant, indicate finalization out of synch.
we run out of disk space on cluster, appreciated.
i found similar issue on our cluster, stemmed failed upgrade.
first make sure finalize upgrade on namenode
hdfs dfsadmin -finalizeupgrade
what found datanodes reason did not finalize directories @ all.
on datanode, should see following directory layout
/[mountpoint}/dfs/dn/current/{blockpool}/current
and
/[mountpoint}/dfs/dn/current/{blockpool}/previous
if have not finalized previous directory contains data created before update. if delete not remove - hence storage never reduces.
actually simplest solution sufficient
restart namenode
watch log of datanode, should see this
info org.apache.hadoop.hdfs.server.common.storage: finalizing upgrade storage directory
afterwards directories cleared in background , storage reclaimed.
Comments
Post a Comment