s3fs挂载看不到对象
我已使用 s3fs 成功挂载了我的存储桶,但我看不到使用 PHP 库创建的对象(子目录中的文件)。如果我在根级别添加一个文件,我就可以看到这一点。如果我在根级别创建一个文件,我就可以看到这一点。如果我创建一个目录,我可以在其中创建项目,但我无法看到之前创建的目录和对象。
如何查看之前创建的项目?我真的很想创建一个 EBS,安装它,然后从 S3 上获取这些东西。我希望像这样安装 S3 会让事情变得简单。
由于我只是尝试将对象从 S3 移动到 EBS,因此我也一直在尝试 s3sync。运气不好。当 s3sync 尝试创建目录时,它创建了一些奇怪的东西......
---x-wx--T 1 root root 272 Oct 21 15:25 /photos/0
./s3sync.rb:638:in `initialize': No such file or directory - /photos/0.s3syncTemp (Errno::ENOENT)
帮助!!!
感谢您的帮助。
汤姆
I have successfully mounts my bucket using s3fs, but I cannot see the objects (files in sub-directories) I created using the PHP library. If I add a file at the root level, I can see that. If I create a file at the root level, I can see that. If I create a directory, I can create items in it, but I cannot see the directories and objects I had previously created.
How can I see items created previously? I really want to create an EBS, mount it, and get this stuff off the S3. I was hoping mounting the S3 like this would make that easy.
Since I am just trying to move objects from S3 to EBS, I have been trying s3sync as well. No luck. When s3sync tried to create directories it created something weird...
---x-wx--T 1 root root 272 Oct 21 15:25 /photos/0
./s3sync.rb:638:in `initialize': No such file or directory - /photos/0.s3syncTemp (Errno::ENOENT)
HELP!!!
Thank for any help.
Thom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是因为子目录没有分配 ACL。
我通过在 S3 上创建一个具有公共读取权限/acl 的子目录对象解决了这个问题。
例如
$s3->putObjectString("", 'bucketName', 'directoryName/', S3::ACL_PUBLIC_READ);
It's because the subdirectories have no ACL assigned.
I solved the problem by creating a subdirectory object with public-read permission/acl on S3.
e.g.
$s3->putObjectString("", 'bucketName', 'directoryName/', S3::ACL_PUBLIC_READ);
我听说如果您使用 S3FS,那么您需要使用该接口来完成所有文件事务。使用 PHP 将文件放入存储桶中可能会正确添加它们,但由于它们不是使用 S3FS 添加的,因此它们可能在安装的驱动器上不可见。
我有一个已安装的 S3FS 系统,用于 Web 备份,并且备份脚本不会创建所有这些冗余文件夹和文件,而是其他进程留下的。使用 Transmit 或其他 S3 访问工具都无法查看这些文件,只有在 Amazon AWS 控制台上您才能看到存储桶的真实内容。
看起来您已经触及了 ACL 的另一个问题。
我建议执行类似的过程,但使用 S3FS 通过命令行或 s3Fox 传输文件,看看它是否产生相同的结果。
I have heard that if you use S3FS, then you need to do all the file transactions using that interface. Putting files into your bucket using PHP may add them correctly, but because they were not added using S3FS they may not be visible on your mounted drive.
I have a mounted S3FS system I use for web backups, and there are all these redundant folders and files that the backup script does not create, but get left over from other processes. None of those files are viewable using Transmit or another S3 access tool, only on the Amazon AWS console can you see the true contents of your bucket.
Looks like you have touched on another problem though with the ACL.
I would suggest doing a simmilar process but using S3FS to transfer the file over command line or s3Fox, see if it produces the same results.