Glassfish 3 EJB 应用程序部署建议?

发布于 2024-10-15 17:57:07 字数 680 浏览 4 评论 0原文

由于各种不幸的管理原因(预算限制等),我(开发人员)被安排在生产环境中部署应用程序。问题是我没有任何生产 EJB 应用程序服务器部署的经验。也就是说,他们知道没有成功的保证。

背景

  • 开发服务器在最新版本的 Netbeans 和 Glassfish v3 上运行,在 mac 机器上
  • 98% / 99% 的正常运行时间还可以,没有财务/关键交易
  • 它是一个客户端/服务器 EJB 3 应用程序,以及 Web 层、业务层层和资源层当前在同一台计算机上运行。
  • 我可以自由选择硬件/软件基础设施
  • 负载估计:平均 10 个同时连接,罕见 200 个峰值
  • 出站公共数据是文本/小图片(适用于 iPhone 客户端),仅入站 HTTP 文本
  • 基本维护将得到处理(备份、服务器重新启动等)

生产部署的我的问题

  • 基础设施方面必须具备什么?最低系统规格等?
  • 保留 Glassfish v3 可以吗?
  • 我应该关注服务器的哪些配置方面?
  • 最坏的情况:如果我部署与开发期间相同的软件基础设施 (Netbeans/Glassfish v3),服务器能否跟上?

任何建议都将受到欢迎。谢谢!

For a variety of unfortunate management reasons (budget constraints etc.) I, the developer, have been put in the position to deploy the app in a production environment. The catch is that I don't have any experience in production EJB application server deployment. That said, they are aware that there are no guarantees of success.

The context:

  • The dev server runs on the latest version of Netbeans with Glassfish v3, on a mac machine
  • 98% / 99% uptime is ok, there are no financial/critical transactions
  • It is a client/server EJB 3 app, and the web tier, business tier, and resource tiers currently run on the same machine.
  • I have the liberty to choose the hw/sw infrastructure
  • Load estimations: 10 simultaneous connexions avg, rare 200 peaks
  • The outbound public data is text/small pics (it's for iPhone clients), inbound HTTP text only
  • Basic maintenance will be taken care of (backup, server reboot, etc)

My questions for production deployment:

  • What are the must haves infrastructure-wise? Minimum system specs etc?
  • Is it ok to keep Glassfish v3?
  • Which configuration aspects of the server should I focus on?
  • Worst case scenario: if I deploy the same software infrastructure (Netbeans/Glassfish v3) as during the development, would the server keep up?

Any piece of advice would be most welcome. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑,眼淚并存 2024-10-22 17:57:07

对于架构,您可以从一个没有前端 Web 服务器的 GlassFish 实例开始(GlassFish 有一个功能非常强大的内置实例)。如果您可以等待 GlassFish 3.1 的发布,您将能够添加实例(集群或独立)并提供可扩展性和集中管理。

我见过的大多数 GlassFish 生产实例都使用 1GB-2GB 的 JVM 堆 (-Xmx) 运行,但如果您在内存中加载大量数据或使用某些框架,您的情况可能会有所不同。如果您想要更好的可靠性,将它们放在单独的机器上显然是一个优势。通过同一台计算机上的两个实例,您可以在一个实例发生故障时提供服务连续性(但如果计算机发生故障则无法提供服务)。

我建议使用“asadmin”命令行工具尽可能编写资源配置(连接池、JDBC 数据源等)和应用程序的脚本,并尽量不在生产平台上使用 NetBeans。

使用模拟负载进行基准测试听起来是明智之举,在上线之前尝试将其放在一起生存指南可能会派上用场。

你没有提到数据库。没有一个吗?

For the architecture, you can start small with just a single GlassFish instance with no front web server (GlassFish has one built in that is very capable). If you can wait for the release of GlassFish 3.1 you'll be able to add instances (clustered or standalone) and offer scalability and centralized admin.

Most production instances of GlassFish I've seen run with 1GB-2GB of JVM heap (-Xmx) but your mileage may vary if you load lots of data in memory or if you use some frameworks. If you want better reliability, having them on separate machines is a plus obviously. With two instances on the same machine you can offer continuity of service if one instance fails (but not if the machine fails).

I'd suggest scripting as much as possible the provisioning of the resources (connection pool , JDBC datasource, etc...) and applications using the "asadmin" command-line tool and try to not use NetBeans on the production platform.

Benchmarking with simulated load sounds like a wise thing to try to put together before going live and this survival guide will probably come in handy.

You don't mention the database. Isn't there one?

心凉怎暖 2024-10-22 17:57:07

我建议如下:

  1. 不是 Mac 专家,但我会说,现在使用 6GB 或更多 RAM
  2. HDD 空间不是问题
  3. 不太了解 Mac 处理器(双核的水等)
  4. 就我个人而言,我没有在 GF3 中使用过生产,但我希望它现在稳定,所以你应该没问题。

系统架构

  1. 接收某个 Web 服务器(Apache 或 Sun Web 服务器)上的所有 HTTP 请求,并与 Glassfish 服务器进行负载平衡。
  2. 现在,根据您的物理(或虚拟)机器,在每台机器上创建 Glassfish 应用程序服务器的实例。如果您只有一台机器,则创建至少 2 个 Glassfish 实例。这将有助于关闭一个节点进行维护,而其他节点则继续运行。
  3. 就部署而言,请确保停止调试日志并微调 JPA 日志等。
  4. 使用 Ant 或其他脚本来部署代码并备份现有代码。

我希望这将有助于启动和休息,您可以在进行过程中提出问题或解决问题。

祝你好运。

I suggest the following:

  1. Not a Mac expert but I'll say go with 6GB or more RAM
  2. HDD space is not a problem these days
  3. Do not know much abt Mac Processors (watever eq of dual core etc)
  4. Personally I have not used GF3 in Production but I hope it's stable now so you should be ok.

System Architecture:

  1. Receive all HTTP requests on some web server (Apache or Sun web server) and load balance with your Glassfish server(s).
  2. Now depending on your physical (or virtual) machines create instance of Glassfish Application Server on each machine. If you just have one machine then create atleast 2 instances of Glassfish. This will help to put one node down for maintaince and other to keep going.
  3. As far as deployment is concern make sure you stop debug logs and fine tune JPA logs etc.
  4. Use Ant or other scripts to deploy code and taking backup of existing code.

I hope this will help to kick start and rest you can ask or solve as you go along.

Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文