简体   繁体   English

使用 gcsfuse 从 Cloud Storage Bucket 读取/写入数据

[英]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.

相关问题 GCP 存储桶可在 UI 中访问,但不能通过云中的 gcsfuse 访问 shell - GCP bucket reachable in UI but not by gcsfuse in the cloud shell GCP 存储 - 从 mongo db 读取数据并将其写入文件 GCP 存储桶 - GCP storage - read data from mongo db and write it into to file GCP bucket 从云存储桶加载数据时找不到数据集错误 - Dataset not found error while loading data from cloud storage bucket 从谷歌云存储桶中读取文件 - Reading files from google cloud storage bucket 使用云存储选项从谷歌存储桶中的目录中删除所有对象 - Delete all objects from a directory in google storage bucket using cloud storage options 从 Google Cloud Storage Bucket 下载文件夹 - Downloading folders from Google Cloud Storage Bucket 云 Function 将数据从云存储桶导入 CloudSQL 但已获取架构存在错误 - Cloud Function to import data into CloudSQL from cloud storage bucket but getting already schema exist error Spring 批量读取器更改为从 GCP 云存储桶读取文件内容 - Spring batch reader changes to read file content from GCP cloud storage bucket 如何将查询结果直接写入谷歌云存储桶? - How to write query result to Google Cloud Storage bucket directly? 将文件从 Azure blob 存储移动到 Google 云存储桶 - Moving Files from Azure blob storage to Google cloud storage bucket
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM