且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

亚马逊的云配置与MySQL的Java EE Web应用程序

更新时间:2023-12-03 23:01:52

我没有基础设施的专家,但我在AWS上的一些经验,我希望我可以帮助,至少你的一些问题。我的背景并没有让我给你关于你的基础设施浆纱任何意见,但我可以帮助建议的那种红外线的。照片 首先,我肯定会去与EBS。除了是从应用服务器在物理上分离的同时,还具有高可靠性和高可用性。我可以告诉你,救了我几次。虽然我说我不会告诉你任何事情大小,我不认为你会需要额外的4容错的实例,但也许你可以保留一些2实例准备起飞的流量,以防万一。

I am no infrastructure expert, but I have some experience on AWS, and I hope I can help with at least some of your questions. My background does not allow me to give you any advice about sizing of your infrastructure, but I can help advising on the kind of infra.
First of all, I would definitely go with EBS. Besides being physically separate from your application server, it is also has high reliability and high availability. I can tell you it saved me a couple of times. Although I said I would not tell you anything about sizing, I don't think you would need the extra 4 "fault tolerance" instances, but maybe you could keep some 2 instances ready to take off traffic, just in case.

关于你的数据库,你一定要继续使用RDS为MySQL(http://aws.amazon.com/rds/mysql/)。他们给您pre-配置的节点,自动打补丁,自动备份,自动复制和一键缩放,在(恕我直言)小的代价。所有这些功能都准备好,即开即用即装即用,为MySQL。您还可以使用度量和监控,它都包括在内。 RDS不给你计算单位,但它是一个很好的做法,让他们在AWS分开。您也可以有4个EC2 Tomcat的节点+ 2 RDS节点的设置。这是大小的问题而已:)

Regarding your DB, you should definitely go ahead and use RDS for MySQL (http://aws.amazon.com/rds/mysql/). They give you pre-configured nodes, auto-patching, auto-backup, auto-replication and one-click scaling, at a (IMHO) small price. All of these features are ready, out-of-the-box, for MySQL. You can also use metrics and monitoring, it is all included. RDS do not give you computing units, but it is a good practice to keep them separate in AWS. You can also have a setup with 4 EC2 Tomcat nodes + 2 RDS nodes. It is just a matter of sizing :)

如果您已经阅读亚马逊的弹性负载平衡,它看起来完美的解决方案。您可以将一些EC2节点到每个ELB节点,而忘记了负载均衡。这只是工作,而且你还可以配置粘性会话,如果你想要的。我不知道,不过,多少ELB节点,你应该选择,但要注意的一个问题:你可以从同一地理区域(比如美国东海岸)只会增加EC2节点相同的ELB。这是不可能的,以平衡之间的流量,例如,西海岸在Tomcat,另一个东海岸。如果您选择在多个地区发布你的节点,则需要配备亚马逊之外的另一个LB解决方案。

If you have already read about Amazon Elastic Load Balancing, it looks perfect for your solution. You can attach some EC2 nodes to each of your ELB nodes, and forget about load balancing. It just works, and you can also configure sticky sessions if you want. I don't know, though, how many ELB nodes you should choose, but be aware of one problem: you can only add EC2 nodes from the same geographic region (e.g. US east coast) to the same ELB. It is not possible to balance traffic between, for example, a Tomcat in West Coast and another one in East Coast. If you choose to distribute your nodes across multiple regions, you will need to come with another LB solution outside of Amazon.

我的最后一点建议:与ELB + EBS为主EC2 + RDS继续。它将简化了很多的监测,部署和维护,并且成本趋向于大大降低。你可能更知道有多少各种节点,你需要的,但不要害怕错过,因为它是很容易的上限或下限的红外线在AWS上。

My final advice: go ahead with ELB + EBS-based EC2 + RDS. It will simplify a lot your monitoring, deployment and maintenance, and the cost tends to be much lower. You are probably more aware of how many of each kind of node you will need, but don't be afraid to miss, because it is very easy to upscale or downscale your infra on AWS.