You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GCE虚拟机中GCSFUSE挂载Cloud Storage桶失败的问题及解决

GCSFUSE挂载Cloud Storage桶报错及解决方法

问题背景

在GCP虚拟机上部署了3D地图制作工具VCPUBLISHER,目标Cloud Storage桶为公开状态,Compute Engine默认账号已配置Storage Admin角色。本地存储文件时工具运行正常,但因单数据集平均超过40GB,计划挂载Cloud Storage桶作为存储介质。

报错情况

执行初始挂载命令:

gcsfuse gs://bucket_name /var/full/path/to/mount/location

返回错误:

Error while mounting gcsfuse: mountWithArgs: mountWithStorageHandle: fs.NewServer: create file system: SetUpBucket: Error in iterating through objects: storage: bucket doesn't exist

但通过gsutil ls可正常列出该桶内的内容,同时GCSFUSE日志中出现额外错误:

Error returned from GetStorageLayout: rpc error: code = InvalidArgument desc = Invalid storage layout name. Storage layout name should be a valid bucket resource name followed by '/storageLayout'.
error details: name = ErrorInfo reason = INVALID_STORAGE_LAYOUT_NAME domain = storage.googleapis.com metadata = map[ ]

解决步骤

  1. 调整挂载目录权限:
    修改挂载目录的所属用户和权限:

    sudo chown user:user /var/full/path/to/mount/location
    sudo chmod 755 /var/full/path/to/mount/location
    

    (注:将user替换为实际执行挂载操作的系统用户)

  2. 修改挂载命令参数:
    使用带额外参数的命令重新挂载:

    gcsfuse -o allow_other --implicit-dirs bucketname /var/full/path/to/mount/location
    

    其中:

    • -o allow_other:允许其他用户访问挂载的文件系统
    • --implicit-dirs:自动识别GCS桶中的虚拟目录结构
    • bucketname:仅填写桶名称,无需gs://前缀

执行以上步骤后,成功完成Cloud Storage桶的挂载,VCPUBLISHER可正常读取桶内数据。

内容的提问来源于stack exchange,提问作者Luis García

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 01:15:55