Google Cloud Storage moun + nginx 用户

Google Cloud Storage moun + nginx 用户

我能够挂载我的 Google Cloud Storage,gcsfuse但我需要 nginx 在其中写入。我该怎么做?我已将 nginx 添加到挂载用户组,但没有任何结果。可能是因为挂载在所有文件夹上都有 755?任何想法都将不胜感激。

伯特

答案1

gcsfuse --help
NAME:
   gcsfuse - Mount a GCS bucket locally

USAGE:
   gcsfuse [global options] bucket mountpoint

VERSION:
   0.21.0 (Go version go1.8)

GLOBAL OPTIONS:
   --foreground                 Stay in the foreground after mounting.
   -o value                     Additional system-specific mount options. Be careful!
   --dir-mode value             Permissions bits for directories, in octal. (default: 755)
   --file-mode value            Permission bits for files, in octal. (default: 644)
   --uid value                  UID owner of all inodes. (default: -1)
   --gid value                  GID owner of all inodes. (default: -1)
   --implicit-dirs              Implicitly define directories based on content. Seedocs/semantics.md
   --only-dir value             Mount only the given directory, relative to the bucket root.
   --key-file value             Absolute path to JSON key file for use with GCS. (default: none, Google application default credentials used)
   --limit-bytes-per-sec value  Bandwidth limit for reading data, measured over a 30-second window. (use -1 for no limit) (default: -1)
   --limit-ops-per-sec value    Operations per second limit, measured over a 30-second window (use -1 for no limit) (default: 5)
   --stat-cache-ttl value       How long to cache StatObject results and inode attributes. (default: 1m0s)
   --type-cache-ttl value       How long to cache name -> file/dir mappings in directory inodes. (default: 1m0s)
   --temp-dir value             Absolute path to temporary directory for local GCS object copies. (default: system default, likely /tmp)
   --debug_fuse                 Enable fuse-related debugging output.
   --debug_gcs                  Print GCS request and timing information.
   --debug_http                 Dump HTTP requests and responses to/from GCS.
   --debug_invariants           Panic when internal invariants are violated.
   --help, -h                   show help
   --version, -v                print the version

示例:gcsfuse --uid=997 --gid=995 --file-mode=755 --dir-mode=755 my-project-3153481321684321681.appspot.com /media/gcloud

答案2

默认情况下,只有挂载文件系统的用户才有权访问它。根据文档您可以使用“-o allow_other”允许其他用户访问文件系统。

gcsfuse 还允许您使用 --uid 和 --gid 标志直接设置 inode 的所有者。

相关内容