Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Delete old BP-* DataNode directories by hand?

avatar
Contributor

By mistake /var/hadoop/hdfs/data was in my list of DataNode directories. I have removed this in Ambari and restarted all services successfully. I was under the impression that /var/hadoop/hdfs/data/current/BP-* would then be deleted but it is still there and taking up space. Is it safe to delete it by hand?

1 ACCEPTED SOLUTION

avatar

@Dr. Jason Breitweg, it will not be deleted automatically.

There may be block files under that directory that you need. If the cluster has any important data - I'd recommend running 'hdfs fsck' to ensure there are no missing/corrupt blocks before you delete /var/hadoop/hdfs/data/current/BP-*.

Even then I'd first move the directory to a different location, restart DataNodes and rerun fsck to ensure you don't cause data loss.

View solution in original post

1 REPLY 1

avatar

@Dr. Jason Breitweg, it will not be deleted automatically.

There may be block files under that directory that you need. If the cluster has any important data - I'd recommend running 'hdfs fsck' to ensure there are no missing/corrupt blocks before you delete /var/hadoop/hdfs/data/current/BP-*.

Even then I'd first move the directory to a different location, restart DataNodes and rerun fsck to ensure you don't cause data loss.