编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

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

caiopo 云计算 2022-5-10 14:49 6人围观

腾讯云服务器
将数据从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实例时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!

腾讯云服务器 阿里云服务器
关注微信
^