[英]How to grant Google compute engine instance access to a cloud storage bucket?
I have a compute engine instance (Ubuntu 16.04) and a storage bucket both in the same project. 我在同一项目中都有一个计算引擎实例(Ubuntu 16.04)和一个存储桶。
I want to mount the storage on the compute instance. 我想在计算实例上安装存储。 I found some resources on this page: https://cloud.google.com/storage/docs/gcs-fuse . 我在此页面上找到了一些资源: https : //cloud.google.com/storage/docs/gcs-fuse 。
I already installed gcsfuse
on the instance and created a directory to mount the storage like this: 我已经在实例上安装了gcsfuse
,并创建了一个目录来装载存储,如下所示:
cd $HOME
mkdir storage
Then I mounted the storage using the gcsfuse
command: 然后,我使用gcsfuse
命令安装了存储:
gcsfuse storage-bucket storage/
According the gcsfuse
output everything looks solid, but when I try to create a test file like: 根据gcsfuse
输出,一切看起来都很稳定,但是当我尝试创建如下测试文件时:
touch storage/test.txt
I get the following error: 我收到以下错误:
touch: cannot touch 'storage/test.txt': Input/output error
I'm kinda stuck at the moment, what else should I try? 我现在有点卡住,还应该尝试什么?
Thanks everyone for the support, meanwhile based on this article I managed to set it up for me: 感谢大家的支持,同时根据这篇文章我设法为我设置了它:
https://www.assistanz.com/mount-google-cloud-storage-bucket-linux/ https://www.assistanz.com/mount-google-cloud-storage-bucket-linux/
Also when I created the instance I set the Access scopes to Allow full acces to all Cloud APIs and now it works like a charm! 同样,当我创建实例时,我将访问范围设置为“ 允许对所有Cloud API完全 访问” ,现在它就像一个魅力一样起作用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.