美文网首页
手动修复 under-replicated blocks in

手动修复 under-replicated blocks in

作者: david9 | 来源:发表于2023-03-08 15:47 被阅读0次

    切换到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
    

    相关文章

      网友评论

          本文标题:手动修复 under-replicated blocks in

          本文链接:https://www.haomeiwen.com/subject/vpdoldtx.html