docker - gcsfuse 在 docker 中读取或写入挂载目录时出现输入/输出错误

标签 docker fuse gcsfuse

我在 docker 容器(基本镜像 centos7)中使用 gcsfuse,但无法读取或写入已安装的目录。

我正在使用 gcsfuse 安装目录,如下所示:

[root@6c24c3a6cc28 /]# gcsfuse --foreground --key-file=/src/gcloud_service_account.json my-bucket /gcloud/
Using mount point: /gcloud
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.

当我尝试读取或写入已安装的目录时,我收到此错误:
[root@6c24c3a6cc28/]# ls -la/gcloud/ ls: 读取目录/gcloud/: 输入/输出错误 共 0

gcsfuse 打印出调试信息:

熔断器:2016/01/14 01:33:41.110260 *fuseops.ReadDirOp 错误:readAllEntries:ReadEntries:ListObjects:获取 https://www.googleapis.com/storage/v1/b/my-bucket/o ? delimiter=%2F&projection=full:私钥应该是 PEM 或普通 PKSC1 或 PKCS8;解析错误:asn1:结构错误:标签不匹配(16 vs {class:1 tag:27 length:123 isCompound:true}){optional:false explicit:false application:false defaultValue: tag: stringType:0 timeType: 0 set:false omitEmpty:false} pkcs1PrivateKey @2

我正在像这样运行 docker: docker run -p 3000:3000\
--特权\ --cap-添加 SYS_ADMIN\ --设备/开发/ fuse \ --name gcsfuseTest\ gcsfuseImage

我不能 100% 确定 --cap-add SYS_ADMIN 和 --device/dev/fuse 能得到什么。我根据在 docker 上使用 fuse 安装的其他用户将它们放入。

最佳答案

我可以通过在运行 gcsfuse 时打开一些调试标志来解决这个问题:

gcsfuse --foreground --debug_gcs --debug_http --debug_fuse --debug_invariants --key-file=/src/gcloud_service_account.json dev-my-bucket/gcloud

这返回了很多信息,以及:

“代码”:403, "message": "访问未配置。您的项目未启用 API(云存储 JSON API)。请使用 Google Developers Console 更新您的配置。"

我在 Google 开发者控制台中启用了这个 API,几分钟后,vuala,它工作了。

关于docker - gcsfuse 在 docker 中读取或写入挂载目录时出现输入/输出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34779921/

相关文章:

c++ - 如何在使用 g++ 编译器时使用 c 样式初始化结构?

ubuntu - 无法在 Google Cloud Bucket 中创建文件

c++ - golang Alpine docker交叉编译C++

java - 如何在Docker容器中部署Spring应用程序?

python - fuse 问题

google-cloud-storage - gcsfuse 挂载退出,状态为 1

gcsfuse - 我的 Google 云存储桶中的文件在哪里?

Docker push nexus private repo 失败,413 Request Entity Too Large

docker - 无法为 gitlab-ci 运行构建

docker - Docker 内部的 FUSE