如何在亚马逊云中部署 Java EE 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4042477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 04:30:52  来源:igfitidea点击:

How to deploy a Java EE application in the Amazon cloud?

javajakarta-eeamazon-ec2cloudcloud-hosting

提问by Mateusz Dymczyk

Here's the thing: I need to take a certain Java EE web app and deploy it to Amazon EC2 (which I will need to setup first) starting next month (using the http://aws.amazon.com/free/faqs/AWS Free Tier Usage - hope it supports Tomcat + MySQL/PostgreSQL).

事情是这样的:我需要从下个月开始(使用http://aws.amazon.com/free/faqs/AWS免费层使用 - 希望它支持 Tomcat + MySQL/PostgreSQL)。


The problem: I have never ever deployed a Java EE app (not even a normalone on a dedicated hosting) nor have I setup an Amazon EC2 enviorment.


问题:我从未部署过 Java EE 应用程序(甚至不是专用主机上的普通应用程序),也从未设置过 Amazon EC2 环境。


Are there any, idiot proof preferably, tutorials/how-to's/whatever on doing it from the very beginning (signing up to Amazon) till the very end (when your app is all up and running)?

I did find some tutorials on how to setup an Amazon EC2 instance, how to normally deploy a Java EE app but what I'm looking for is a single tutorial putting it all together.


从一开始(注册亚马逊)到最后(当您的应用程序全部启动并运行时),是否有任何白痴证据最好,教程/操作方法/无论做什么?

我确实找到了一些关于如何设置 Amazon EC2 实例、如何正常部署 Java EE 应用程序的教程,但我正在寻找的是将它们放在一起的单个教程。

采纳答案by Spike Gronim

Start with an Ubuntu AMI. Then install tomcat. Now put the WAR file of your J2EE app where tomcat can see it. You can use the AWS consoleto start/stop your machines, configure firewall rules that allow you to access port 80, etc. There won't be a step by step guide telling you exactly what to do, welcome to being a programmer.

Ubuntu AMI开始。然后安装 tomcat。现在将 J2EE 应用程序的 WAR 文件放在 tomcat 可以看到的地方。您可以使用AWS 控制台启动/停止您的机器,配置允许您访问端口 80 的防火墙规则等。不会有一步一步的指南告诉您具体该怎么做,欢迎成为程序员。

回答by Jaider

Once we have the instance (like Ubuntu) running http://youtu.be/hJRSti6DsJgthen, installs Glassfish (Java EE server) and configure it to work with Java EE. It depends more of the instance itself (Ubuntu) than EC2 Amazon... here a nice video (how to install Glashfish in Ubuntu + Netbeans config) http://youtu.be/CKuoDm6bqRM

一旦我们拥有运行http://youtu.be/hJRSti6DsJg的实例(如 Ubuntu),然后安装 Glassfish(Java EE 服务器)并将其配置为与 Java EE 一起使用。它更多地取决于实例本身(Ubuntu)而不是 EC2 Amazon...这里有一个不错的视频(如何在 Ubuntu + Netbeans 配置中安装 Glashfish)http://youtu.be/CKuoDm6bqRM

Note:

笔记:

  • Keep in mind both videos are a little old (may some adjustments are necessary)
  • The videos are indirectly related. But my point is: there isn't much info about Amazon AWS and Java EE, but there are a lot info about Amazon AWS and Linux, and Linux and Java EE.
  • 请记住,这两个视频都有些旧(可能需要进行一些调整)
  • 这些视频是间接相关的。但我的观点是:关于 Amazon AWS 和 Java EE 的信息不多,但有很多关于 Amazon AWS 和 Linux、Linux 和 Java EE 的信息。

UpdateYou can try Amazon Beanstalk (Deployment & Management) integrated with Netbeans (without Glashfish?) http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.html

更新您可以尝试与 Netbeans 集成的 Amazon Beanstalk(部署和管理)(没有 Glashfish?)http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/GettingStarted.html

SSH to Elastic Beanstalk instance

SSH 到 Elastic Beanstalk 实例

http://aws.amazon.com/java/(Amazon + Java)

http://aws.amazon.com/java/(亚马逊 + Java)

enter image description here

在此处输入图片说明

回答by Axel Fontaine

Boxfusenow 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 (AMIs, security groups, auto-scaling groups, launch configurations, ELBs, Elastic IPs, ...) and launch the instances. It supports blue/green zero downtime updates with Elastic IPs and ELBs.

这将创建一个映像,配置所有必要的 AWS 基础设施(AMI、安全组、自动扩展组、启动配置、ELB、弹性 IP 等)并启动实例。它支持使用弹性 IP 和 ELB 进行蓝/绿零停机更新。

You can find a tutorial here: https://boxfuse.com/blog/javaee-aws

您可以在此处找到教程:https: //boxfuse.com/blog/javaee-aws

Disclaimer: I am the founder and CEO of Boxfuse

免责声明:我是 Boxfuse 的创始人兼 CEO