bash 带有 s3fs 和保险丝的 Amazon S3。卸载和挂载脚本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14090105/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Amazon S3 with s3fs and fuse. script to unmount and mount
提问by ilansch
Redhat with Fuse 2.4.8
S3FS version 1.59
Redhat with Fuse 2.4.8
S3FS 版本 1.59
In addition to: Amazon S3 with s3fs and fuse, transport endpoint is not connected
此外:Amazon S3 带有 s3fs 和保险丝,传输端点未连接
I would like to make a script to fix the situation. The script will unmount and mount the the directory. the commands i need to use are:
fusermount -u /s3
/usr/bin/s3fs -o allow_other bucketname /s3
我想制作一个脚本来解决这个问题。该脚本将卸载并挂载目录。我需要使用的命令是:
fusermount -u /s3
/usr/bin/s3fs -o allow_other bucketname /s3
For people who familiar with this situation, should I be concerned with something else ? or this is enough ?
对于熟悉这种情况的人,我应该关心其他事情吗?或者这就够了?
回答by Michel Feldheim
You shouldn't use amazon s3 as a unix file system in a productive environment. S3 is not built like this. From the s3fs docs
您不应该在生产环境中将 amazon s3 用作 unix 文件系统。S3 不是这样构建的。来自s3fs 文档
Important Limitations Eventual Consistency Due to S3's "eventual consistency" limitations file creation can and will occasionally fail. Even after a successful create subsequent reads can fail for an indeterminate time, even after one or more successful reads. Create and read enough files and you will eventually encounter this failure. This is not a flaw in s3fs and it is not something a FUSE wrapper like s3fs can work around. The retries option does not address this issue. Your application must either tolerate or compensate for these failures, for example by retrying creates or reads. For more details, see Eventual Consistency
重要限制 最终一致性 由于 S3 的“最终一致性”限制,文件创建可能并且偶尔会失败。即使在成功创建之后,后续读取也可能会在不确定的时间内失败,即使是在一次或多次成功读取之后。创建并读取足够的文件,您最终会遇到此故障。这不是 s3fs 的缺陷,也不是像 s3fs 这样的 FUSE 包装器可以解决的问题。重试选项没有解决这个问题。您的应用程序必须容忍或补偿这些失败,例如通过重试创建或读取。有关更多详细信息,请参阅最终一致性
回答by George
Good read.
好读。
I think to circumvent, my 2-cents worth is that you could do a minute-ly cron to copy files from the mounted S3 drive to your server. If the context suits, that is
我认为为了规避,我 2 美分的价值是您可以每分钟执行一次 cron 将文件从安装的 S3 驱动器复制到您的服务器。如果上下文适合,那就是

