无法在Google Cloud Bucket中创建文件

时间:2018-01-24 17:08:33

标签: ubuntu google-cloud-storage

在Google Cloud上我有4个存储桶,我有两个运行的虚拟机,一个是Ubuntu 14,另一个是16个。在这两台机器上,我可以挂载(gcsfuse)所有四个存储桶。

但是,我遇到了一个(也是唯一一个)存储桶(project-x-logs)的问题。在运行Ubuntu 14的机器上,我可以创建一个文件:

user@instance-4 > pwd
/home/user/work/Project-X/project-x-logs
user@instance-4 > touch del.me
user@instance-4 > ls -l
total 0
-rw-r--r-- 1 user user 0 Jan 24 17:00 del.me
user@instance-4 > 

我可以在Ubuntu 16机器上看到它:

user@instance-gpu-6 > pwd
/home/user/work/Project-X
user@instance-gpu-6 > cd project-x-logs/
user@instance-gpu-6 > ls -l 
total 0
-rw-r--r-- 1 user user 0 Jan 24 17:00 del.me
user@instance-gpu-6 > 

所以看起来这个桶已正确安装在两台机器上。

然而,当我尝试在Ubuntu 16机器上创建另一个文件时,我收到一个错误:

user@instance-gpu-6 > pwd
/home/user/work/Project-X/project-x-logs
user@instance-gpu-6 > touch delmetoo.me
touch: cannot touch 'delmetoo.me': Input/output error
user@instance-gpu-6 > 

我尽可能地打开了烫发,但似乎没有任何效果。

任何有关如何解决此问题或至少进行调试的建议都将非常受欢迎。

1 个答案:

答案 0 :(得分:0)

经过大量的实验和搜索,我能想出的最佳解决方案是运行以​​下内容:

(python35gpu) user@instance-gpu-6 > gcloud auth application-default login

You are running on a Google Compute Engine virtual machine.
The service credentials associated with this virtual machine
will automatically be used by Application Default
Credentials, so it is not necessary to use this command.

If you decide to proceed anyway, your user credentials may be visible
to others with access to this virtual machine. Are you sure you want
to authenticate with your personal account?

Do you want to continue (Y/n)?  Y

Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/auth?redirect_uri=big_long_link


Enter verification code: <paste sha-type code here>

Credentials saved to file: [/home/user/.config/gcloud/application_default_credentials.json]

These credentials will be used by any library that requests
Application Default Credentials.
(python35gpu) user@instance-gpu-6 > 

点击终端窗口中的big_long_link将在Chrome中打开一个显示sha-type代码的标签。将其剪切并粘贴到终端提示符中,应该授予对任何新桶或现有桶的访问权限(它们仍然需要挂载,但是0