douhuang2218 2017-05-13 15:39
浏览 64
已采纳

AWS中的Joomla部署,尤其是管理在多个可用区域中运行的Web服务器(实例)之间的公共文件/文件夹

What will be the Joomla configuration Log, Tmp paths in configuration.php when we are deploying application on AWS VPC- EC2 Instance. My VPC is auto scalable, hence I assume that some how the Logs should be in any shared location? or should be on EC2 Instance local location? Also what will be the path that we will use to mention in our configuration.php of joomla.

public $log_path = '/home/public_html/logs'; 
public $tmp_path = '/home/public_html/temp'; 
  • 写回答

1条回答 默认 最新

  • doumi2106 2017-06-01 06:45
    关注

    In VPC when we are having multiple availability zones in which our web server is running, there we get common problem on shared media contents. For example in one particular case when log or temp path, and in case of images or files that could be uploaded by user/admin or generated by the application.

    When Load Balancer directs website traffic to random servers(running in different availability zones) this becomes a big problem to tackle.

    In such cases, we must need to have a shared common location that holds these media files (that are uploaded by users or generated by the application). Otherwise each server (in a availability zone) will be saving files separately, and if by chance last time user uploaded photo being in Availability Zone-A server the next time if user directed to (by Load Balancer) Availability Zone-B server the files will not be there. This is a very bad case.

    Solutions:

    1. Preferably it is recommended to user AWS EFS service that is designed by AWS to address this particular need. This creates a common location to hold shared/common files, that can be accessed more like a local filesystem folder. Just like NFS mounted folder.

    2. You can use S3 storage which is also recommended in some cases, but you need to modify or setup your code in a way that it can handle S3 storage filesystem. Moreover you can also mount S3 storage to your Web server (EC2 Instance) using 3rd party S3FS. But AWS does recommend to 50% recommendation. As AWS may not be able to do some monitoring stuff that helps customers to monitor the traffic and other stuff.

    3. You can also create a stand alone EC2 instance which main job will only be to hold these common media files. This can be created anywhere in Public or Private subnet, it will work as far as it is in the same Route Table as other Subnets are. We can use this Instance as NFS by create required number of directories in this instance and exporting them to specific web servers (sitting in our different availability zones) or can also export to range of IPs (if we have setup Auto Scalable Group in AWS). Then each client (web server) need to mount the exported directories to the locations which and where our application expect those directories. These directories will then act like a normal local directory but will be common across all running web server in different availability zones.

    4. If we have a NAT EC2 Instance running, we can also use it to act as a NFS server and create directories on it and export them to web servers.

    Conclusion: The space and budget cost are two important factors. The performance is more like similar in all cases mentioned above. When we have media files under <10GB then we either should use right EC2 instance for NFS. But as if we setup separate EC2 instance the option#3 may cost of read/writes in future, in that case option#4 will be more appropriate. S3 is right option as well but when we have option to change the code accordingly. S3 is also right option for huge file sizes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图