ech*_*dee 10 fuse google-cloud-storage google-cloud-platform gcsfuse
我们目前正在尝试为一些需要大量存储的工作负载演示谷歌云平台。我们正在尝试使用谷歌云存储,但在使用 gcsfuse 安装存储桶时遇到问题。我目前能够以 root 用户身份挂载我的测试桶(设置了 allow_other 选项),但非 root 用户只有读取权限。
我尝试过和检查过的事情:
gcloud config list | grep account已获得此存储分区的所有者访问权限这是控制台输出 - Catting and touching animal.txt 以更新时间戳。
root@vm-00 cloud]# grep bucket /etc/fstab
test_bucket_00 /data/cloud/tb-00 gcsfuse rw,allow_other
[root@vm-00 cloud]# mount tb-00
Calling gcsfuse with arguments: -o rw -o allow_other test_bucket_00 /data/cloud/tb-00
Using mount point: /data/cloud/tb-00
Opening GCS connection...
Opening bucket...
Mounting file system...
File system has been successfully mounted.
[root@vm-00 cloud]# mount | grep bucket
test_bucket_00 on /data/cloud/tb-00 type fuse (rw,nosuid,nodev,allow_other,default_permissions)
[root@vm-00 cloud]# ls -lh /data/cloud/tb-00/animal.txt ; date ; touch/data/cloud/tb-00/animal.txt ; ls -lh /data/cloud/tb-00/animal.txt
-rw-r--r--. 1 root root 20 Jan 21 00:24 /data/cloud/tb-00/animal.txt
Thu Jan 21 00:25:37 UTC 2016
-rw-r--r--. 1 root root 20 Jan 21 00:25 /data/cloud/tb-00/animal.txt
[root@vm-00 cloud]# cat /data/cloud/tb-00/animal.txt
ants bats cats dogs
[root@vm-00 cloud]# ls -lh /data/cloud
total 4.0K
drwxr-xr-x. 1 root root 0 Jan 21 00:25 tb-00
[root@vm-00 cloud]# chmod 777 /data/cloud/tb-00
[root@vm-00 cloud]# ls -lh /data/cloud
total 4.0K
drwxr-xr-x. 1 root root 0 Jan 21 00:25 tb-00
[root@vm-00 cloud]# gcloud config list
Your active configuration is: [NONE]
[core]
account = REDACTED1234-compute@developer.gserviceaccount.com
disable_usage_reporting = True
project = testing1-1148
[root@vm-00 cloud]#
Run Code Online (Sandbox Code Playgroud)
现在作为非root 用户,我可以看到animal.txt 的内容,但我无法触摸该文件或在该目录中创建新文件。:
[testuser@vm-00 ~]$ cat /data/cloud/tb-00/animal.txt
ants bats cats dogs
[testuser@vm-00 ~]$ touch /data/cloud/tb-00/mineral.txt
touch: cannot touch `/data/cloud/tb-00/mineral.txt': Permission denied
[testuser@vm-00 ~]$ gcloud config list
Your active configuration is: [NONE]
[core]
account = REDACTED1234-compute@developer.gserviceaccount.com
disable_usage_reporting = True
project = testing1-1148
Run Code Online (Sandbox Code Playgroud)
gcsfuse 是解决此问题的正确方法,还是有更好的解决方案来安装在系统范围内可用的谷歌云存储桶?我知道文档说不要以 root 身份安装存储桶,但我没有看到任何可以解释它为什么不好的东西。我尝试以非 root 用户身份挂载,但出现权限问题,即使在将用户添加到 fuse 组之后也是如此。我不确定这是否与我的问题有关,但是一旦我开始工作,我很乐意深入研究。
| 归档时间: |
|
| 查看次数: |
12363 次 |
| 最近记录: |