我已经在我的 aws EC2 机器上安装了Zeppelin以连接到我的 spark 集群。
Spark 版本: 独立:spark-1.2.1-bin-hadoop1.tgz
在我的用例中尝试访问 S3 中的文件时,我能够连接到 spark 集群但出现以下错误。
代码:
sc.hadoopConfiguration.set("fs.s3n.awsAccessKeyId", "YOUR_KEY_ID")
sc.hadoopConfiguration.set("fs.s3n.awsSecretAccessKey","YOUR_SEC_KEY")
val file = "s3n://<bucket>/<key>"
val data = sc.textFile(file)
data.count
file: String = s3n://<bucket>/<key>
data: org.apache.spark.rdd.RDD[String] = s3n://<bucket>/<key> MappedRDD[1] at textFile at <console>:21
ava.lang.NoSuchMethodError: org.jets3t.service.impl.rest.httpclient.RestS3Service.<init>(Lorg/jets3t/service/security/AWSCredentials;)V
at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.initialize(Jets3tNativeFileSystemStore.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:85)
我通过以下命令构建了 Zeppelin:
mvn clean package -Pspark-1.2.1 -Dhadoop.version=1.0.4 -DskipTests
当我尝试使用 hadoop 配置文件“-Phadoop-1.0.4”构建时,它会警告它不存在。
我也试过这个spark 网站中提到的 -Phadoop-1 。但得到了同样的错误。 1.x 到 2.1.x hadoop-1
请让我知道我在这里缺少什么。