亚马逊的云配置与MySQL的Java EE Web应用程序 [英] Amazon Cloud configuration for Java EE web app with MySQL

查看:267
本文介绍了亚马逊的云配置与MySQL的Java EE Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作,我需要将一些现有的企业Java应用程序AWS。我已经通过aws.amazon.com许多网页消失了,也一派不够。此外,我曾尝试去通过在计算器相关的所有问题。所有这些事情做了很多事情说清楚,但是,我仍然有一些混乱。这是我们的应用程序的结构:

In my work I need to move some existing Enterprise Java applications to AWS. I have gone through many pages on aws.amazon.com and also googled enough. Also, I have tried to go through all the related questions at stackoverflow. All these things made many things clear, however, I am still having some confusion. Here is our application structure:

  1. 这是一个基于Spring的应用程序,它使用了Spring MVC为presentation层和普通的Java接口和类来处理业务和数据逻辑。
  2. MySQL正在使用的持久性。

因此​​,应用程序体系结构是很简单的。然而,美中不足的是,我们需要部署的应用程序的多个实例。此计数是目前15,可以超越30还有一点是,所有这些实例共享一个共同的数据库。

So, the application architecture is simple enough. However, the catch is that we need to deploy many instances of this application. This count is currently 15 and can go beyond 30. One more point is that all these instances share a common database.

现在这里就是我们需要实现通过移动到AWS:

Now here is what we need to achieve by moving to AWS:

  1. 在更高的容错应用程序。最近,我们面临的专用主机服务器/电源故障导致几个小时的停机时间。
  2. 应用程序的响应时间和吞吐量方面所有的实例更高的性能。
  3. 在更高的容错能力为MySQL。应用实例下跌对我们的服务器最近,一个颇具由于一些硬件(硬盘驱动器),基本上导致MySQL的意外停止。硬盘驱动器上的整个文件系统只去读取故障造成的托管服务器上的应用程序实例。
  4. 显然降低了基础设施管理的总成本和开销。

至于我能理解AWS基础设施到现在,这里就是我们需要在AWS为我们的设置:

As far as I am able to understand AWS infrastructure till now, here is what we would need in AWS for our setup:

  1. 在4个实例,每个主机约10应用程序实例,有些EBS基于Linux的AMI使用Tomcat和MySQL的安装上。
  2. 在我猜测,我们还需要1实例容错为每个4个实例中的所有共8实例。
  3. 所有服务器实例将有大约EBS的160GB。
  4. 4弹性IP地址
  5. 4弹性负载平衡器
  6. 在其他的东西,如快照等

现在这里是我的问题:

  1. 我真的需要有额外的服务器实例(容错)每个主服务器实例,考虑到EBS会自动备份通过AWS的脸和他们将提供新的EBS,在案件的同一数据硬件故障?

  1. Do I really need to have that extra server instance(for fault tolerance) for each main server instance, considering the face that EBS are automatically backed up by AWS and they would provide new EBS with same data in case of hardware failure?

我将如何分享上面的场景中的所有服务器实例(4×2)中的数据库?一个选择,我看到的是落实在那些服务器实例的MySQL集群。比方说,MySQL的集群将包含1管理节点,3个SQL节点和4个数据节点。然而,在这种情况下,保持簇将是我们的额外开销,并且这可能不被接受,因为我们想摆脱基础设施管理的

How would I share database among all server instances (4x2) in above scenario? One option I am seeing is to implement MySQL clustering among those server instance. Lets say, the MySQL cluster would contain 1 Management Node, 3 SQL nodes and 4 Data Nodes. However, in this case maintaining the cluster would be an additional overhead for us and this may not be accepted as we would like get rid of infrastructure management.

我需要有RDS,而不是数据库,并从所有服务器isntances(4×2)删除MySQL的实例?如果是的话,我会需要购买RDS实例除了EC2实例(我想,如果我需要买不同的实例的RDS那么总的基础设施的成本将至少增加了75%。)或RDS实例也给计算单元对于应用程序的开发因而减少用于应用程序部署实例的总数

Do I need to have RDS instead for database and remove MySQL instances from all server isntances (4x2)? If yes, would I need to buy RDS instances in addition to EC2 instances (I think, if I need to buy separate instances for RDS then cost of total infrastructure would increase at least by 75%.) or the RDS instances also gives compute units for application development thus reducing the total number of instances for application deployment?

在的情况下RDS实现,确实人真正需要的EBS基于EC2实例?如果我们能一些如何从EC2实例与RDS实例到位删除EBS的要求,我们可以降低总成本。

In case of RDS implementation, does one really need EBS based EC2 instances? If we can some how remove EBS requirement from EC2 instances with RDS instances in place, we can reduce the total cost.

任何帮助将是AP preciated并请让我知道如果我没有明确的指定我的问题,需要更多的澄清任何一点。

Any help would be appreciated and please let me know if I am not clear to specify my problem and need more clarification for any point.

推荐答案

我没有基础设施的专家,但我在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.

这篇关于亚马逊的云配置与MySQL的Java EE Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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