【问题标题】:Authentication errors with Cloud Dataproc and other Google Cloud productsCloud Dataproc 和其他 Google Cloud 产品的身份验证错误
【发布时间】:2015-11-02 21:55:47
【问题描述】:

我正在尝试将Google Cloud PubSub 与我的Google Cloud Dataproc 集群一起使用,但我遇到了如下的身份验证范围错误:

{
  "code" : 403,
  "errors" : [ {
    "domain" : "global",
    "message" : "Request had insufficient authentication scopes.",
    "reason" : "forbidden"
  } ],
  "message" : "Request had insufficient authentication scopes.",
  "status" : "PERMISSION_DENIED"
}

如何解决此问题,以便在 Cloud Dataproc 上运行的 Spark/Hadoop 项目中使用 PubSub(和其他 Google Cloud)产品?

【问题讨论】:

    标签: google-cloud-platform google-cloud-pubsub google-cloud-dataproc


    【解决方案1】:

    Google Cloud Dataproc 默认包含一些 authentication scopes,但目前不包含所有 Google Cloud Platform 产品的范围。您可以通过使用Google Cloud SDK 创建范围并使用--scopes 标志将范围添加到集群。

    例如,您可以在使用 gcloud beta dataproc clusters create 命令添加 PubSub 范围 --scopes https://www.googleapis.com/auth/pubsub 时使用以下标志。只要服务处理“catch all”范围,您就可以使用--scopes https://www.googleapis.com/auth/cloud-platform 一次为多个服务添加范围。

    您可以在Google Cloud Platform docs 上找到有关身份验证和授权的更多信息。

    【讨论】:

    • 我们可以在创建 dataproc 集群后添加或更新范围
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-06
    • 1970-01-01
    • 2014-10-11
    • 1970-01-01
    • 2017-09-23
    • 1970-01-01
    • 2022-12-17
    相关资源
    最近更新 更多