[英]Read/Write data to/from Cloud Storage Bucket using gcsfuse
To mount Google Cloud Storage Bucket onto a directory on a local machine for processing.将 Google Cloud Storage Bucket 挂载到本地机器上的目录中进行处理。 Using a manjaro environment and installed gcsfuse manually.使用 manjaro 环境并手动安装 gcsfuse。
in the gs://bucket01, there are directories containing jpg and json files在 gs://bucket01 中,有包含 jpg 和 json 文件的目录
go get -u github.com/googlecloudplatform/gcsfuse
$GOPATH/src/github.com/googlecloudplatform/gcsfuse
GOOGLE_APPLICATION_CREDENTIALS=/run/media/manjaro/gcp/key.json gcsfuse bucket01 /run/media/manjaro/gcp/bucket01
Using mount point: /run/media/manjaro/gcp/bucket01
Opening GCS connection...
Mounting file system...
File system has been successfully mounted.
cd /run/media/manjaro/gcp/bucket01
ls
# empty
# The expected outcome is data from gs://bucket01 populates /run/media/manjaro/gcp/bucket01
# Updates in /run/media/manjaro/gcp/bucket01 will also be seen in gs://bucket01
Am i using gcsfuse correctly?我是否正确使用 gcsfuse?
Please try using Implicit directories请尝试使用隐式目录
As mentioned above, by default there is no allowance for the implicit existence of directories.如上所述,默认情况下不允许隐式存在目录。 Since the usual file system operations like mkdir will do the right thing, if you set up a bucket's structure using only gcsfuse then you will not notice anything odd about this.由于通常的文件系统操作(如 mkdir)会做正确的事情,如果您仅使用 gcsfuse 设置存储桶的结构,那么您不会注意到这有什么奇怪的。 If, however, you use some other tool to set up objects in GCS (such as the storage browser in the Google Developers Console), you may notice that not all objects are visible until you create leading directories for them.但是,如果您使用其他工具在 GCS 中设置对象(例如 Google Developers Console 中的存储浏览器),您可能会注意到在为它们创建引导目录之前并非所有对象都是可见的。
gcsfuse supports a flag called --implicit-dirs that changes the behavio gcsfuse 支持一个名为--implicit-dirs的标志,它改变了行为
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.