在namenode崩溃后重建Accumulo会破坏根块

时间:2016-05-14 12:51:24

标签: hadoop hdfs hortonworks-data-platform accumulo

我们的开发HDP群集停电损坏了Accumulo使用的一些HDFS系统块,现在群集处于安全模式,ambari将无法重启。

作为DEV盒子,HDFS的复制因子为1,因此无法恢复损坏的块。

重建Accumulo以干净地恢复HDFS文件系统并重新启动HDP群集的最佳方法是什么?累积中没有用户数据可以保存,因此在这种情况下擦除和重新初始化会很好。只是不确定最好的方法。

一些腐败细节:

endlocal & goto Menu%UsersChoice%

输出是:

hdfs fsck / | egrep -v '^\.+$' | grep -v replica | grep -v Replica| grep "^\/" | grep "CORRUPT" | sed 's/: CORRUPT.*//' | grep -v "^$"

群集详细信息:

Connecting to namenode via http://xyz.fakedomain.com:50070/fsck?ugi=andrew&path=%2F
/apps/accumulo/data/tables/!0/table_info/A000133q.rf
/apps/accumulo/data/tables/+r/root_tablet/A000133t.rf
/apps/accumulo/data/tables/1/default_tablet/F000133r.rf
/user/accumulo/.Trash/Current/apps/accumulo/data/tables/+r/root_tablet/delete+A000133t.rf+F000133s.rf

1 个答案:

答案 0 :(得分:3)

首先找到坏块:

hdfs fsck / | egrep -v '^\.+$' | grep -v eplica

然后删除相关块中的文件并删除:

hdfs dfs -rm -skipTrash /some/path/to/files

由于HDFS用户运行以下内容:

hdfs dfsadmin -safemode leave

hdfs dfs -rm -R -skipTrash hdfs://servername:8020/apps/accumulo

hadoop fs -mkdir -p /apps/accumulo
hadoop fs -chmod -R 700 /apps/accumulo
hadoop fs -chown -R accumlo:accumulo /apps/accumulo

从Ambari重新启动Accumulo以初始化或运行:

/usr/hdp/current/accumulo-client/bin/accumulo init

然后从

开始
/usr/hdp/current/accumulo-client/bin/start-all.sh