0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

hdfsの容量が枯渇した時に大きいファイルを探す方法

Posted at

hdfsの容量枯渇でhadoopが動作しなくなり、てんやわんやしたので一時対応方法を残しておく。

コマンド一覧
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/FileSystemShell.html#df

ディスクの確認をする

hadoop fs -df -h

hadoop dfsadmin -report

フォルダとファイルの使用量確認

フォルダごとのディスク使用量を確認

hadoop fs -du -s /${folder}/* | sort -n

ファイルごとのサイズを確認

hadoop fs -du /${folder}/* | sort -n

削除方法

ファイルの削除方法

hadoop fs -rm ${file}

フォルダ内のファイルを全部削除する方法

hadoop fs -rm -r /${folder}/*

しかしこれだけだとtrashフォルダに移動するだけなので、trashも削除する必要がある。

hadoop fs -expunge

か以下コマンドで削除をする

hadoop fs -rm -r /user/${whoami}/.Trash/*

まとめ

そもそもhdfsのディスク監視の必要性があるのでは。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?