【问题标题】:Gcloud compute ssh --zone=us-east1-d --ssh-flag="-D" --ssh-flag="10000" --ssh-flag="-N" "spark-01-m" is not workingGcloud 计算 ssh --zone=us-east1-d --ssh-flag="-D" --ssh-flag="10000" --ssh-flag="-N" "spark-01-m" 不是在职的
【发布时间】:2020-08-09 02:26:01
【问题描述】:

当我使用以下命令设置 ssh 隧道时,我收到以下错误,我无法解决。

命令:gcloud compute ssh --zone=us-east1-d --ssh-flag="-D" --ssh-flag="10000" --ssh-flag="-N" "spark-01-m"

C:\Users\ssv1>gcloud compute ssh --zone=us-east1-d --ssh-flag="-D" --ssh-flag="10000" --ssh-flag="-N" "spark-01-m"
ERROR: (gcloud.compute.ssh) You do not currently have an active account selected.
Please run:

  $ gcloud auth login

to obtain new credentials, or if you have already logged in with a
different account:

  $ gcloud config set account ACCOUNT

to select an already authenticated account to use.

enter image description here

【问题讨论】:

  • 错误信息告诉你该怎么做。您是否尝试按照这些说明进行操作?发生了什么?
  • 注意:对 SSH 使用特殊标志通常不适用于 Windows。阅读 gcloud 启动的程序 Putty 的文档。但是,您需要先正确设置 Google Cloud SDK。 cloud.google.com/sdk/docs/quickstart-windows

标签: apache-spark ssh google-cloud-platform gcloud


【解决方案1】:

根据您收到的消息,问题似乎与您缺乏凭据有关:

您目前没有选择有效的帐户。 请运行:

$ gcloud 身份验证登录

google auth 命令需要通过您的 Gmail/gSuite 帐户或 service account 进行身份验证。

对于 Gmail 帐户,您只需运行已经提到的命令,然后按照以下步骤操作:

$ gcloud 身份验证登录

至于服务帐号则必须使用:

gcloud auth activate-service-account --key-file="file.json"

此外,我还建议使用以下命令设置您想要的 GCP 项目:

gcloud 配置设置项目project-id>

之后您应该不会再看到错误消息,但您可能会发现@john-hanley 提到的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-11
    • 1970-01-01
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多