S3 存储桶在 EC2 实例上随机卸载
我的公司目前正在使用 AWS 的 S3fs 和 Ec2。我们已将 s3 存储桶挂载到 Ec2 实例上,但一段时间后(例如一周),一些存储桶会自行卸载,我们的服务器实例几乎变得无用。错误是“传输端点未连接”。
S3fs 版本:1.61 从源代码构建
FUSE 版本:2.84.1 从源代码构建
操作系统:Linux、Ubuntu 11.04
是否有某种安全机制来防止(或至少检测)这些问题?
My company currently is using S3fs and Ec2 from AWS. We have been mounted our s3 buckets on our Ec2 instances, but after some time (a week, for example) some of the buckets unmount by themselves and our server instances become nearly useless. The error is "Transport endpoint not connected."
S3fs version: 1.61 build from source
FUSE version: 2.84.1 build from source
OS: Linux, Ubuntu 11.04
Is there some kind of safe mechanism for preventing (or at least detecting) these problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
伟大的洞察力。没有想过这个。但我们可以采取以下 3 个预防措施:
1) 创建自动挂载,以便在极少数情况下 EC2 宕机时,一旦 EC2 通过 /etc/fstab 恢复,S3 就会重新挂载
2) 或/并且如果您愿意,可以使用 cron 创建辅助自动挂载:
添加此行
3) 我还会创建另一个每小时 cron 来检查 S3 是否仍然挂载 - 这可以通过检查虚拟文件是否存在于你的EC2 路径。如果该文件不存在,cron 将通过调用“/usr/bin/s3fs -o allowed_other [s3 存储桶名称] [挂载点路径]”进行手动挂载。最好向管理员发送一封电子邮件并将其记录到系统中。
Great insight. Hadn't thought about this. But here are 3 precautionary steps we can take:
1) Create an auto-mount so that in the very unlikely event that EC2 is down, S3 gets mounted back on once EC2 comes back via /etc/fstab
2) or/and if you prefer, create a secondary auto-mount using cron:
add this line
3) I would also create another hourly cron to check whether S3 is still mounted - this can be done by checking if a dummy file exists in your EC2 path. If the file doesn't exist, cron will do a manual mount by calling "/usr/bin/s3fs -o allow_other [s3 bucket name] [mountpoint path]". It would be good to trigger an email to the admin and log it in the system as well.
s3fs 是一个好主意,但请记住,即使对 s3 的调用可能是内部的(或者说“在他们的网络上”),您仍然通过 HTTP 挂载文件系统。从长远来看,这种情况并不稳定。
也许您可以重新表述您的问题以寻求替代方案,并分享您试图通过使用任何类型的(我猜)共享网络文件系统来完成的任务。我可以看到这种吸引力,但对于 Amazon EC2,人们通常使用不共享的方法,并且应该避免任何与网络相关的额外内容,以便能够更轻松地回收实例,等等。
很高兴扩展我的答案。
s3fs is a nice idea but keep in mind that even though the call to s3 might be somewhat internal (or let's say "on their network"), you're still mounting a filesystem over HTTP. That is not going to be stable in the long-run.
Maybe you can re-phrase your question to ask for alternatives and share what you're trying to accomplish by using any kind of (I'm guessing) shared network filesystem. I can see the appeal, but with Amazon EC2 people usually use a shared nothing approach and anything extra network-related should be avoided to be able to recycle instances easier, etc..
Happy to extend my answer.