在AWS EMR上运行Spark Java应用程序时出现文件系统问题

时间:2016-04-23 00:28:05

标签: java hadoop amazon-s3 apache-spark amazon-emr

我正在使用Spark in Java开发大数据应用程序。该应用程序使用存储数据集(.gz文件)的Amazon S3服务。我使用数据集的一个文件完成了在笔记本电脑上本地开发代码,并尝试在Amazon EMR上对数据集的所有文件运行代码。但问题是它无法从Amazon S3获取FileSystem上的文件。我尝试使用:

   hadoopConf.set("fs.s3.impl", "org.apache.hadoop.fs.s3native.NativeS3FileSystem")
   hadoopConf.set("fs.s3.awsAccessKeyId", myAccessKey)
   hadoopConf.set("fs.s3.awsSecretAccessKey", mySecretKey)

和路径:

     S3://accessKey:secertKey@path

,错误是:

org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2584)
org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2591) at
org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:91) 
org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2630) 
org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2612) at 
org.apache.hadoop.fs.FileSystem.get(FileSystem.java:370) at 
org.apache.hadoop.fs.Path.getFileSystem(Path.java:296) at 
org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(FileInputForma‌​t.java:256) 

0 个答案:

没有答案
相关问题