0705-5.16.2-HDFS文件浏览器异常分析

  • 2019 年 10 月 7 日
  • 笔记

异常重现

在CM上从HDFS进入文件浏览器,出现异常提示如下

Reports Manager (Reports Manager (cdh01)) 无法完成请求" Could not access index for service 'hdfs'. If High Availability is enabled, nameservice must also be specified.  

查看Reports Manager的角色日志,发现下面异常信息

Error starting search service  org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported in file 'segments_2': 1701995890 (needs to be between -1 and -11). This version of Lucene only supports indexes created with release 3.0 and later.    Index build failed for service hdfs  org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported in file 'segments_2': 1701995890 (needs to be between -1 and -11). This version of Lucene only supports indexes created with release 3.0 and later.  
  • 测试环境:

1.Redhat7.2

2.采用root用户操作

3.CM和CDH为5.16.2

异常分析

根据异常提示,’ Index build failed for service hdfs’,可以知道是为服务HDFS创建索引失败,导致了进入HDFS的文件浏览器异常。无法进入HDFS的索引。这种情况考虑可能是Reports Manager的工作目录下的索引文件损坏,导致RM启动的时候创建索引失败。我们通过rebulid索引目录来进行异常排除。

异常解决

1.停止Reports Manager服务

2.把RM的工作目录下的文件全部移动到/root目录下

[root@cdh01 ~]# mv /var/lib/cloudera-scm-headlamp/* /root/  

3.启动Reports Manager服务

4.启动完成,重新从HDFS进入文件浏览器成功

总结

1.Reports Manager为HDFS创建索引失败,会导致从HDFS进入文件浏览器异常。而Reports Manager的工作目录下文件损坏或者其他原因都可能会导致创建索引失败。

2.通过删除Reports Manager工作目录下的文件,再重新启动Reports Manager来重新创建索引,可以解决这个异常。

3.Reports Manager启动的时候是通过读取HDFS的fsimage来创建新的索引的,所以Reports Manager启动时间,根据fsimage的大小,从几秒到几十分钟不等。

Fayson的github: https://github.com/fayson/cdhproject