将数据从Cloud Build容器传输到Google Compute Engine实例时出现问题 [英] Problem with data transfer from Cloud Build container to Google Compute Engine instance

本文介绍了将数据从Cloud Build容器传输到Google Compute Engine实例时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在使用 Cloud Build 生成一些需要部署到GCE实例的工件.为此,我尝试将 gcloud 构建器与以下参数一起使用:

Currently I'm using Cloud Build to produce some artifacts that I need to deploy to GCE instance. I've tried to use gcloud builder for this purpose with the following args:

- name: 'gcr.io/cloud-builders/gcloud' 
  args: ['compute', 'scp', '--zone=<zone_id>', '<local_path>', '<google compute engine instance name>:<instance_path>']

,构建失败,并出现以下错误:

and build fails with the following error:

ERROR: (gcloud.compute.scp) Could not SSH into the instance.  It is 
possible that your SSH key has not propagated to the instance yet. Try 
running this command again.  If you still cannot connect, verify that 
the firewall and instance are set to accept ssh traffic.

我已经在实例上打开了端口 22 ,但这并没有帮助我.
你们可以帮我解决这个问题吗?
我需要在构建定义中检查/修复哪些点?
可能是可以给我一个建议,而不是我可以用来将数据从 Cloud Build 容器传送到 GCE 实例的 gcloud 吗?

I've already opened port 22 on my instance but that haven't helped me.
Could you guys help me to solve this problem?
What points I need to check/fix in my build definition?
May be you can give me an advice which builder instead of gcloud I can use to deliver my data from Cloud Build container to the GCE instance?

推荐答案

要尝试的几件事:

1.确保您可以正常使用此方式.

1.Make sure you can ssh normally this way.

对SSH进行故障排除,如果第一步失败.

2.尝试将SSH目标从"instancename"更改为"username @ instance",以指示VM内的用户名称,例如

2.Try to change the SSH target from 'instancename' to 'username@instance' in order to indicate the name of the user inside the VM, eg

username @ InstanceName

username@InstanceName

这篇关于将数据从Cloud Build容器传输到Google Compute Engine实例时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆