【问题标题】:How to grant Google compute engine instance access to a cloud storage bucket?如何授予 Google 计算引擎实例访问云存储桶的权限?
【发布时间】:2017-12-07 14:52:24
【问题描述】:

我在同一个项目中有一个计算引擎实例 (Ubuntu 16.04) 和一个存储桶。

我想在计算实例上挂载存储。我在这个页面上找到了一些资源:https://cloud.google.com/storage/docs/gcs-fuse

我已经在实例上安装了gcsfuse 并创建了一个目录来挂载存储,如下所示:

cd $HOME
mkdir storage

然后我使用gcsfuse 命令安装存储:

gcsfuse storage-bucket storage/

根据gcsfuse 的输出,一切看起来都很可靠,但是当我尝试创建一个测试文件时:

touch storage/test.txt

我收到以下错误:

touch: cannot touch 'storage/test.txt': Input/output error

我现在有点卡住了,我还应该尝试什么?

【问题讨论】:

  • 检查您的实例范围以确保它具有 Cloud Storage 访问权限。您可能还需要使用服务帐号来访问存储桶,具体取决于其权限。
  • 在安装时使用--foreground 标志将错误打印到stderr。如果这还不够详细,请尝试--debug_fuse
  • 我发现this issuethis issue 在安装桶时通过显式提供--key-file 参数得到解决。也许会有所帮助?

标签: google-cloud-platform google-cloud-storage google-compute-engine ubuntu-16.04 gcsfuse


【解决方案1】:

感谢大家的支持,同时根据这篇文章,我设法为我设置了它:

https://www.assistanz.com/mount-google-cloud-storage-bucket-linux/

此外,当我创建实例时,我将 访问范围 设置为 允许完全访问所有云 API,现在它就像一个魅力!

【讨论】:

    猜你喜欢
    • 2016-09-05
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2019-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-01
    相关资源
    最近更新 更多