什么时候需要在 Glassfish 中使用单独的域?

发布于 2024-09-12 10:14:56 字数 169 浏览 0 评论 0原文

如果您想在 Glassfish 服务器上托管多个相当独立的应用程序,是否需要单独的域?特别是:

  1. 同一域中的应用程序是否会以某种方式相互干扰?
  2. 同一域中的不同应用程序可以侦听不同的 IP 地址/端口吗?

如果是这样,您何时/为什么要实际使用单独的域?

If you want to host multiple, fairly independent applications on a Glassfish server, do you need separate domains? In particular:

  1. Can applications in the same domain interfere with each other in some way?
  2. Can different apps in the same domain listen on different IP addresses/ports?

If so, when/why would you actually use a separate domain?

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

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

发布评论

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

评论(2

救星 2024-09-19 10:14:56

从逻辑角度来看,单独的域或多个应用程序在单个域中共存是类似的(可以配置HTTP端口等)。

主要区别在于,在一种情况下,您有一个 JVM 运行所有应用程序,而在另一种情况下,您有多个 JVM。这可以产生很大的不同。在我们的一个客户站点上,我们最初将所有内容部署在一个域/JMV 中,但最终决定将部署拆分为多个域/JVM,因为它可以提供更好的性能,尤其是垃圾收集时间。所以,是的,应用程序可以干扰,但是以一种非常间接的方式。

此外,Java EE 应用程序无法真正关闭或启动,因此域是您可以打开和关闭电源的最小单位。在某些情况下,它很方便。

最后,有些东西是每个域的,比如 app。服务器日志级别、计时器持久性等。如果您希望两个应用程序具有不同的此类设置,则需要两个域。

From a logical point of view, separate domains or co-existence of several apps in a single domain are similar (You can configure HTTP ports, etc.).

A main difference is that in one case you have one JVM running all the apps, and in the other case you have several JVMs. This can make a big difference. On one of our customer site, we initially deployed everything in one domain/JMV, but finally decided to split the deployment in several domains/JVM because it was giving better performance, especially garbage collection time. So yes, applications can interfere but in a very indirect way.

Also, Java EE apps can't really be shutdown or started, so the domain is the smallest unit that you can power on and off. In some cases, it's handy.

Lastly, there are things that are per-domain, like app. server log levels, timer persistence, etc. If you want two apps with different settings for such things, you will need two domains.

嘿嘿嘿 2024-09-19 10:14:56

考虑以下场景:您的域中部署了 2 个应用程序:轻量级前端应用程序和后端处理应用程序(假设每小时按计划任务运行并处理大量数据)。在这种情况下,您可能会遇到后端应用程序占用虚拟机拥有的所有资源的问题,从而导致前端应用程序在极端情况下无响应,或者更糟糕的是,终止 jvm(例如内存不足错误或永久代空间错误)。

如果您将其分成两个域,即使您的后端内容停止运行,其他应用程序也是安全的,因为它有自己的虚拟机和内存可供使用。

Consider this scenario: You have 2 applications deployed in your domain: lightweight frontend app and backend processing app (Say running as scheduled task every hour and processing huge quantities of data). In such scenario you could have the problem of backend app taking up all the resources your VM has making frontend app unresponsive in extremal scenarios, or even worse, kill the jvm (say out of memory error, or perm gen space errors).

IF you split that into two domains, even if your backend stuff brakes, other application is safe as it has it's own VM and memory to play with.

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