【问题标题】:Request had insufficient authentication scopes请求的身份验证范围不足
【发布时间】:2017-08-09 15:20:14
【问题描述】:

我正在尝试在 dataproc 主节点上使用 gcloud 运行 pyspark 应用程序。我得到“请求的身份验证范围不足”

# gcloud dataproc jobs submit pyspark --cluster xxxxx test.py

gcloud.dataproc.jobs.submit.pyspark) You do not have permission 
to access        cluster [xxxxxx] (or it may not exist): 
Request had  insufficient authentication scopes

我可以通过 Jobs GUI 运行相同的应用程序。我现在没有 doc 的链接,但它说如果在 Compute VM 上运行它,则不需要单独的凭据,这似乎与我使用 GUI 运行相同的应用程序时一致。有什么帮助吗?

【问题讨论】:

    标签: pyspark gcloud google-cloud-dataproc


    【解决方案1】:

    从 Dataproc 节点运行时,您将代表附加到 VM 的 service account 执行操作。通常您将使用默认计算引擎服务帐户,但这也可以使用 Dataproc service account configuration 指定。除了服务帐户之外,还有一个 scopes 列表,它限制了该服务帐户可以从该 VM 访问哪些 GCP 服务。默认情况下,有 BigQuery、GCS、日志记录和其他一些小范围,但没有用于创建其他虚拟机或 Dataproc 集群等操作的一般管理范围。

    要授予必要的范围,您必须在首次创建集群时添加--scopes

    gcloud dataproc clusters create --scopes cloud-platform ...
    

    【讨论】:

      猜你喜欢
      • 2021-08-07
      • 2021-01-04
      • 2021-10-20
      • 2021-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-22
      • 2019-12-23
      相关资源
      最近更新 更多