hdfs raid从facebook移植过来很久了,包括hadoop0.20.203和hadoop2.4.0版本,但是最近才准备上线hadoop2.4.0版本的hdfs raid,上线前准备在好好测试测试,确保上线顺利,hdfs raid代码分成两部分,一部分是hdfs下面的代码,这部分代码上一次和其他patch一起已经上线,另外一部分是raid自己比较独立的代码,按照之前的计划,后一部分代码准备只部署在RaidNode节点和gateway上面,这样对集群的影响是最小的,不需要重启hadoop进程,在测试RaidNode的时候一切都很正常,但是昨天在gateway上面测试hdfs raid配置对提交job的影响时出现了问题,其实在gateway上面hdfs raid增加的配置比较简单,增加的配置是fs.hdfs.impl,值为DistributedRaidFileSystem,该类大部分功能主要由DistributedFileSystem来完成的,由配置项fs.raid.underlyingfs.impl来指定,DistributedRaidFileSystem自己有一个很大的功能就是数据恢复功能,当用户在gateway上面get数据时,如果要获取的数据出现数据块损坏,这个时候就由DistributedRaidFileSystem来完成数据恢复功能,同时gateway上面提交的job要处理的数据刚好数据块丢失时,也可以使用DistributedRaidFileSystem来恢复,hdfs-site.xml配置如下:
<!-- raid begin -->
<property>
<name>fs.hdfs.impl</name>
<value>org.apache.hadoop.hdfs.DistributedRaidFileSystem</value>
<description>The FileSystem for hdfs: uris.</description>
</property>
<property>
<name>fs.raid.underlyingfs.impl</name>
<value>org.apache.hadoop.hdfs.DistributedFileSystem</value>
<description>The raid FileSystem underlying impl.</description>
</property>
在gateway上面提交mapreduce 作业时,MRAppMaster启动失败,jobhistory上面显示报找不着DistributedRaidFileSystem类错误。
2014-12-24 23:04:14,518 INFO [main] org.apache.hadoop.service.AbstractService: Service org.apache.hadoop.mapreduce.v2.app.MRAppMaster failed in state INITED; cause: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.hadoop.hdfs.DistributedRaidFileSystem not found
java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.hadoop.hdfs.DistributedRaidFileSystem not found
at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1895)
at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2379)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2392)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)
at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2431)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2413)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:167)
at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.getFileSystem(MRAppMaster.java:496)
at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.serviceInit(MRAppMaster.java:284)
at org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
at org.apache.hadoop.mapreduce.v2.app.MRAppMaster$1.run(MRAppMaster.java:1459)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1550)
at org.apache.hadoop.mapreduce.v2.app.MRAppMaster.