【问题标题】:Read/Write data to/from Cloud Storage Bucket using gcsfuse使用 gcsfuse 从 Cloud Storage Bucket 读取/写入数据
【发布时间】:2021-01-24 03:15:21
【问题描述】:

将 Google Cloud Storage Bucket 挂载到本地计算机上的目录中进行处理。 使用 manjaro 环境并手动安装 gcsfuse。

在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

我使用 gcsfuse 正确吗?

【问题讨论】:

    标签: google-cloud-platform google-cloud-storage manjaro gcsfuse


    【解决方案1】:

    请尝试使用Implicit directories

    如上所述,默认情况下不允许隐式 目录的存在。由于通常的文件系统操作像 mkdir 会做正确的事,如果你设置了一个桶的结构 只使用 gcsfuse 那么你不会注意到这有什么奇怪的。 但是,如果您使用其他工具在 GCS 中设置对象(例如 Google Developers Console 中的存储浏览器),您可能会注意到 在您创建前导目录之前,并非所有对象都是可见的 给他们。

    gcsfuse 支持一个名为 --implicit-dirs 的标志,它可以更改 行为

    【讨论】:

    • 谢谢。我已经尝试过了,在 ls 在目录上之前等待了 10 分钟。所有目录和文件都出现了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-25
    • 2020-03-26
    • 2019-09-01
    • 2022-12-13
    • 1970-01-01
    • 2019-02-14
    • 1970-01-01
    相关资源
    最近更新 更多