hadoop - Unable to find large files in Linux using "du -h" -
i have hadoop cluster running out of space recently. try clean logs disk space. run command df -h
, shows:
/dev/sda1 22g 20g 1.9g 92% / /dev/sda3 1.8t 747g 960g 44% /data/1 /dev/sdb1 1.8t 755g 986g 44% /data/2 /dev/sdc1 1.8t 754g 987g 44% /data/3 /dev/sdd1 1.8t 745g 996g 43% /data/4
the hdfs under dir /data
fine. root dir /
has little space left. used tool ncdu
can calculate rapidly disk usage of dir, shows:
2.9tib [##########] /data 1.5gib [ ] /home 800.9mib [ ] /usr 716.3mib [ ] /var 349.1mib [ ] /lib 293.8mib [ ] /opt
there no large directory. tried command such du -a | sort -n -r | head
, still unable find invisible dir or file. know other way find out problem is?
thanks
i find answer.
cause have deleted large log file didn't reclaim space in filesystem , it's still taking disk space. that's why result of commands du -h
, df -h
not match.
solution
root@linux:# lsof / | grep deleted java 15393 hdfs 114w reg 8,1 4463704 655506 /var/log/hadoop/hdfs/hadoop-hdfs-datanode-hslave.log (deleted)
the command lsof
list open files. file opened when deleted it. second column shows pid of process opened file.
root@linux:# cd /proc/15393/fd/ root@linux:# ls -l | grep deleted l-wx------ 1 hdfs hadoop 64 jul 25 17:55 114 -> /var/log/hadoop/hdfs/hadoop-hdfs-datanode-hslave.log (deleted) root@linux:# > 114
type file descriptor shows in previous line (114). space reclaimed.
Comments
Post a Comment