我们正在为我们的网络应用添加一项功能,其中上传文件(到应用服务器)由后台工作人员(其他机器)处理.
应用程序的性质意味着这些文件会持续一段时间.在worker上执行的代码知道文件何时变得无关紧要,并且应该在那时删除该文件.
我的直觉是要求我们的系统管理员使用NFS设置共享文件夹.任何Web服务器都可以将文件保存到NFS中,任何工作人员都可以将其提取出来进行处理.信号与信号编排工作通过共享Redis实例中的数据进行.
关于NFS,有人告诉我:
Typically,for this kind of use case,we route all upload requests to
a single web server. The server that handles uploads will write the
files to a directory,say /data/shared/uploads which is then
synchronized in a read-only fashion to all other servers.
听起来他们不喜欢NFS.我问问题是什么.有人告诉我:
In regards to NFS or any other shared file system,the problem is
always the same – it introduces a single point of failure. Not only
that,it also tightly couples all servers together. Problems with one
server can affect the others,which defeats the purpose of load
balancing and de-coupling.
我们目前处于多个Web服务器和工作者的规模,但仍然是单个DB和Redis实例.因此,我们已经存在与我们紧密耦合的单点故障.
NFS是否有问题以至于上述参数有效?