gsutil在GCE中不起作用 [英] gsutil not working in GCE

查看:61
本文介绍了gsutil在GCE中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,当我使用标准的debian 7映像启动GCE实例并发出"gsutil config"命令时,它将失败并显示以下消息:

So when I bring up a GCE instance using the standard debian 7 image, and issue a "gsutil config" command, it fails with the following message:

jcortez@master:~$ gsutil config Failure: No handler was ready to authenticate. 4 handlers were checked. ['ComputeAuth', 'OAuth2Auth', 'OAuth2ServiceAccountAuth', 'HmacAuthV1Handler'] Check your credentials.

jcortez@master:~$ gsutil config Failure: No handler was ready to authenticate. 4 handlers were checked. ['ComputeAuth', 'OAuth2Auth', 'OAuth2ServiceAccountAuth', 'HmacAuthV1Handler'] Check your credentials.

我已经在debian 6和centos实例上进行了尝试,并且得到了相同的结果.发出"gcutil config"可以正常工作.我收集到我需要设置我的〜/.boto文件,但是我不确定该怎么做.

I've tried it on the debian 6 and centos instances and had the same results. Issuing "gcutil config" works fine however. I gather I need to set up my ~/.boto file but I'm not sure what to.

我在做什么错了?

推荐答案

将服务帐户范围用作E. Anderson 提到了在Compute Engine上使用gsutil的推荐方法,因此将图像配置为从/etc/boto.cfg中的元数据服务器获取OAuth访问令牌:

Using service account scopes as E. Anderson mentions is the recommended way to use gsutil on Compute Engine, so the images are configured to get OAuth access tokens from the metadata server in /etc/boto.cfg:

[GoogleCompute]
service_account = default

如果您想自己管理gsutil配置,请重命名/etc/boto.cfg,gsutil config应该可以:

If you want to manage gsutil config yourself, rename /etc/boto.cfg, and gsutil config should work:

$ sudo mv /etc/boto.cfg /etc/boto.cfg.orig
$ gsutil config
This script will create a boto config file at
/home/<...snipped...>/.boto
containing your credentials, based on your responses to the following questions.
<...snip...>

这篇关于gsutil在GCE中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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