我该如何EC2负载均衡正确设置为允许即时文件同步? [英] How do I get EC2 load balancing properly set up to allow for real time file syncing?

查看:406
本文介绍了我该如何EC2负载均衡正确设置为允许即时文件同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的EC2。我读了很多关于它,看了很多视频和教程和pretty的很多熟悉的一切是如何工作的。我仍然有一些问题,我似乎无法找到直接的答案。

如果我有3个实例(Linux)的负载平衡所有服务于相同的网站,该网站是一个动态的PHP / MySQL的驱动,用户发布的每一秒文件论坛主题,数据库和文件是如何同步到所有3个事例即时的。

  1. 请我需要有RDS数据库,每一个实例,仅指向它。
  2. 在怎么样的用户文件。如果用户上传文件到网站,那么这个文件应该立即在所有情况下立即可用,这怎么可能。我不认为有3实例3份是非常实用的。
  3. 如果我修改了网站,让我们说改变CSS文件的东西,我怎么同步更改所有实例。
  4. 在这一切如何EBS或S3发挥作用。
解决方案
  

我需要有RDS数据库,每一个实例仅指向它。

这是一种选择,也可以启动另一个实例坐在应用服务器后面,把MySQL的它,让他们都连接到该实例。有一点需要注意,请务必使用专用IP连接通过内部网络,并确保所有的安全性是紧的。

  

怎么样的用户文件。如果用户上传文件到网站,那么这个文件应该立即在所有情况下可用   随即,这怎么可能。我不认为有3份3   实例是非常实用的。

没有那是不实际的。你可以把它上传到后端数据库实例,他们都可以访问,但实际上你应该把它上传到S3在所有的情况下,可以用s3tools什么用水桶。

  

如果我修改了网站,让我们说改变CSS文件的东西,我怎么同步更改所有实例。

Git的。 (或者SVN),但你可以使用CloudFront的为您的JS和CSS文件....不是一个坏主意。并使用S3斗作为源...

  

在这一切如何EBS或S3起到一定的作用。

您的数据库应该始终在EBS卷,所以你不要失去它。 S3可用于共享和存储便宜和容易的文件在您的整个环境。

I'm new to EC2. I have read a lot about it, watched many videos and tutorial and pretty much familiar with how everything work. I still have few question that I can't seem to find direct answers to.

If I have 3 instances (linux) with load balancing all serving the same site and the site is a dynamic php/mysql driven where users post files forum threads every second, how is the database and files synced to all 3 instances in real time.

  1. Do I need to have the database on RDS where every instance simply points to it.
  2. How about user files. If a user uploaded a file to the site, then this file should be available immediately on all instances immediately, how is this possible. I don't think having 3 copies on 3 instances is very practical.
  3. If I modify the site, let's say change the something in the CSS file, how do I sync the changes to all instances.
  4. How do EBS or S3 play a role in all of this.

解决方案

Do I need to have the database on RDS where every instance simply points to it.

That is one option, or you can boot up another instance to sit behind the app servers, put MySQL on it and have them all connect to that instance. One thing to note, make sure to connect over the internal network using the private ip and make sure all your security is tight.

How about user files. If a user uploaded a file to the site, then this file should be available immediately on all instances immediately, how is this possible. I don't think having 3 copies on 3 instances is very practical.

No that is not practical. You could upload it to that backend db instance that they all have access to, but really you should probably upload it to S3 in a bucket that all your instances can use with s3tools or something.

If i modify the site, let's say change the something in the CSS file, how do i sync the changes to all instances.

Git. (or svn) But you could use cloudfront for your JS and CSS files.... not a bad idea. And use a S3 bucket as your source...

How do EBS or S3 play a role in all of this.

Your database should always be on ebs volumes so you dont lose it. S3 can be used to share and store files cheaply and easily across your entire environment.

这篇关于我该如何EC2负载均衡正确设置为允许即时文件同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆