集群的一些问题

 Web页面出现一些错误:

namenode 出现 missing blocks的解决方案

There are 2 missing blocks. The following files may be corrupted:

blk_1078468526 /user/spark/sparkstreamingcheckpoint/checkpoint-1517487380000
blk_1078468528 /user/spark/sparkstreamingcheckpoint/checkpoint-1517487400000

Please check the logs or run fsck in order to identify the missing blocks. See the Hadoop FAQ for common causes and potential solutions.

通过 hdfs dfs -cat  /user/spark/sparkstreamingcheckpoint/checkpoint-1517487380000 发现确实有两个blocks丢失

这两个blocks的两个副本都丢失了,所以才导致hdfs发出这个警告。

数据已经无法恢复,只能通过命令删除元数据来消除警告。

hdfs dfs -rm -r -f  /user/spark/sparkstreamingcheckpoint/checkpoint-*

一旦出现这种情况,数据基本无法恢复,所以配置HDFS的副本数时尽可能3个以上。


 

猜你喜欢

转载自www.cnblogs.com/Vowzhou/p/10922066.html