【问题标题】:Access Openstack Swift from Spark - SwiftAuthenticationFailedException从 Spark 访问 Openstack Swift - SwiftAuthenticationFailedException
【发布时间】:2019-04-22 15:39:32
【问题描述】:

我正在尝试从 Spark 2.4 访问 Openstack Swift,但出现错误。

org.apache.hadoop.fs.swift.exceptions.SwiftAuthenticationFailedException: Authenticate as tenant '78axxxxxxxxxxxxxxxxxxxxxxxxxxxx' PasswordCredentials{username='xxxxxxxxxxxx'}

sc.hadoopConfiguration.set(s"fs.swift.service.ovh.auth.url", "https://auth.cloud.ovh.net/v3/")
sc.hadoopConfiguration.set(s"fs.swift.service.ovh.tenant", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
sc.hadoopConfiguration.set(s"fs.swift.service.ovh.username", "xxxxxxxxxxxx")
sc.hadoopConfiguration.set(s"fs.swift.service.ovh.password", "xxxxxxxxxxxxxxxxxxxx")
sc.hadoopConfiguration.set(s"fs.swift.service.ovh.http.port", "8080")
sc.hadoopConfiguration.set(s"fs.swift.service.ovh.region", "BHS3")
sc.hadoopConfiguration.set(s"fs.swift.service.ovh.public", "false")

我相信这些凭据是正确的,因为它们直接来自 openstack rc 文件,我可以在使用 python-swiftclient 时很好地使用它们。我也尝试过使用 v2.0 端点,但没有成功。

不幸的是,我总是收到这个非常笼统的错误消息,它不会告诉我哪个部分失败了。有没有更好的调试方法?

【问题讨论】:

    标签: apache-spark hadoop openstack openstack-swift


    【解决方案1】:

    我使用了我从 OVH spark 提交团队收到的以下示例。 一个重要的注意事项是使用租户名称而不是 openstack.rc 文件中的租户 ID。

    val hadoopConf = spark.sparkContext.hadoopConfiguration
    
    hadoopConf.set("fs.swift.impl","org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem")
    hadoopConf.set("fs.swift.service.auth.endpoint.prefix","/AUTH_")
    hadoopConf.set("fs.swift.service.abc.http.port","443")
    hadoopConf.set("fs.swift.service.abc.auth.url","https://auth.cloud.ovh.net/v2.0/tokens")
    hadoopConf.set("fs.swift.service.abc.tenant","<TENANT NAME> or <PROJECT NAME>")
    hadoopConf.set("fs.swift.service.abc.region","<REGION NAME>")
    hadoopConf.set("fs.swift.service.abc.useApikey","false")
    hadoopConf.set("fs.swift.service.abc.username","<USER NAME>")
    hadoopConf.set("fs.swift.service.abc.password","<PASSWORD>")
    

    https://github.com/mojtabaimani/spark-wordcount-swift-scala/blob/master/src/main/scala/com/ovh/example/SparkScalaApp.scala

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-15
      • 2019-04-06
      • 1970-01-01
      相关资源
      最近更新 更多