手动修复 under-replicated blocks in
2023-03-08 本文已影响0人
david9
切换到hdfs用户,执行:
su - hdfs
hdfs fsck / | grep 'Under replicated' | awk -F':' '{print $1}' >> /tmp/under_replicated_files
新建脚本repair.sh并执行:
cd /tmp && touch repair.sh && chmod u+x repair.sh
脚本内容如下:
for hdfsfile in `cat /tmp/under_replicated_files`;do
echo "Fixing $hdfsfile :" ;
hadoop fs -setrep 3 $hdfsfile;
done