简体   繁体   English

在EC2上运行Java EE应用程序

[英]Run Java EE app on EC2

Can anyone point me to the steps/resources that describe: 任何人都可以向我指出描述的步骤/资源:

  1. How to deploy a Java EE app on amazon-EC2 如何在amazon-EC2上部署Java EE应用程序
  2. Maintain changes to the meta-data of the app server (deploy new applications) after an instance reboot (probably using amazon-ebs) 在实例重新启动后保持对应用服务器元数据的更改(部署新应用程序)(可能使用amazon-ebs)

First check this out if you haven't already ran through it: http://docs.aws.amazon.com/gettingstarted/latest/awsgsg-intro/intro.html 如果你还没有完成它,请先检查一下: http//docs.aws.amazon.com/gettingstarted/latest/awsgsg-intro/intro.html
it'll give you an idea of how it all works. 它会让你知道它是如何工作的。

With regard to running a Java EE app on EC2, you have a couple of choices - but they generally come down to the following recipe: 关于在EC2上运行Java EE应用程序,您有几个选择 - 但它们通常归结为以下配方:

  1. Start an instance 启动一个实例
  2. Install a Java EE application server (tomcat/glassfish/websphere/...) 安装Java EE应用程序服务器(tomcat / glassfish / websphere / ...)
  3. Install your application (war/ear) into the application server 将应用程序(war / ear)安装到应用程序服务器中

Now you can bundle the above into an ebs ami, or you can write a script (bash/sh/tcl) which applies those changes when your instance starts (which i prefer). 现在你可以将上面的内容捆绑到一个ebs ami中,或者你可以编写一个脚本(bash / sh / tcl),它在你的实例启动时应用这些更改(我更喜欢)。 The scripts allow you to modify what gets installed/started/moved around without having to rebundle your instance. 这些脚本允许您修改安装/启动/移动的内容,而无需重新绑定您的实例。

There's some great resources here: http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=100 这里有一些很棒的资源: http//developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID = 100

Hope that helps. 希望有所帮助。

How to deploy a Java EE app on amazon-EC2 如何在amazon-EC2上部署Java EE应用程序

You still deploy to an application server so it isn't really different. 您仍然部署到应用程序服务器,因此它并没有真正的不同。 If you have more specific questions, please clarify. 如果您有更具体的问题,请澄清。 But have a look at Running JEE applications on Amazon EC2 and How to deploy a java web application on an ec2 instance . 但请看一下在Amazon EC2运行JEE应用程序以及如何在ec2实例上部署Java Web应用程序

Maintain changes to the meta-data of the app server (deploy new applications) after an instance reboot (probably using amazon-ebs) 在实例重新启动后保持对应用服务器元数据的更改(部署新应用程序)(可能使用amazon-ebs)

If you use Amazon EBS, then you don't need to worry, Amazon EBS volumes are off-instance storage that persists independently from the life of an instance . 如果您使用Amazon EBS,那么您不必担心, Amazon EBS卷是非实例存储,可以独立于实例的生命周期而存在

The Amazon AWS's newly Launched Elastic BeanStalk is here to resolve you concerns. 亚马逊AWS最新推出的Elastic BeanStalk可以帮助您解决问题。 You can deploy Java EE apps on Amazon Ec2 instances via Bean Stalk. 您可以通过Bean Stalk在Amazon Ec2实例上部署Java EE应用程序。 All you need to do is create a new applications and create a environment in it and add you WAR file for deploying, AWS has its own version of Tomcat 6/7 with open JDK which can be customized to Sun JDK if required. 您需要做的就是创建一个新的应用程序并在其中创建一个环境并添加WAR文件进行部署,AWS有自己的Tomcat 6/7版本,带有开放的JDK,如果需要,可以自定义为Sun JDK。

Therefore Amazon offers complete Deployment tool to start using your app by just deploying in BeanStalk. 因此,亚马逊提供完整的部署工具,只需在BeanStalk中部署即可开始使用您的应用。 BeanStalk offer Auto Scaling & Elastic Load balancing and a lots more to customize your application Environment. BeanStalk提供Auto Scaling和Elastic Load平衡以及更多来定制您的应用程序环境。

如果启动ebs引导的实例,则在重新启动后无需关心持久性(请参阅http://aws.amazon.com/about-aws/whats-new/2009/12/03/amazon-ec2- instances-now-can-boot-from-amazon-ebs / )关于Java EE的部署,我认为在非虚拟操作系统上部署它没有任何区别。

Boxfuse supports deploying Java EE applications using either Tomcat, TomEE Web Profile or TomEE Plus to AWS with a single command Boxfuse支持使用Tomcat,TomEE Web Profile或TomEE Plus通过单个命令将Java EE应用程序部署到AWS

boxfuse run mytomeeapp-1.0.war -env=prod

This will create an image, provision all necessary AWS infrastructure and launch the instances. 这将创建映像,配置所有必需的AWS基础结构并启动实例。 It supports blue/green zero downtime updates with Elastic IPs and ELBs. 它支持使用弹性IP和ELB进行蓝/绿零停机更新。

You can find a tutorial here: https://boxfuse.com/blog/javaee-aws.html 你可以在这里找到一个教程: https//boxfuse.com/blog/javaee-aws.html

You don't have to worry about maintaining changes to the meta-data as all instances are immutable and contain all necessary app server info. 您不必担心维护对元数据的更改,因为所有实例都是不可变的并且包含所有必需的应用服务器信息。

Disclaimer: I am the founder and CEO of Boxfuse 免责声明:我是Boxfuse的创始人兼首席执行官

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM