Java 应用程序复制状态

发布于 2024-10-19 03:08:58 字数 297 浏览 3 评论 0原文

我在多台计算机上运行相同的服务器端应用程序。

我想提供一种将更改推送到所有应用程序的方法。我对对象本身的状态/属性更改更感兴趣,而不是文件的复制等。

因此,我设想一个管理控制台,我将在其中更改一些属性,并使更改影响每个应用程序状态。

我目前正在研究 JGroups,这是一个用于可靠多播通信的工具包。在这种情况下,每个应用程序将侦听同一多播组,并且管理控制台将向该组发送更改。

还有其他可用的解决方案/技术吗?

I have the same server side application running on multiple machines.

I would like to provide a way to push changes to all the applications. I'm more interested in state/property changes to the objects themselves, and not so much replication of files, etc.

So I'm envisioning an admin console, where I would change some property, and have the change affect each applications state.

I am currently looking into JGroups, which is a toolkit for reliable multicast communication. In this case, each application would listen in on the same multicast group, and the admin console would send changes to the group.

Are there any other solutions/techniques available?

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

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

发布评论

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

评论(4

幼儿园老大 2024-10-26 03:08:58

存在很多技术,corba、rmi 等。但是,如果您想要一个没有中央服务器的完全分布式系统,我个人会推荐 JGroups

如果您有中央服务器,您可以

  • 让服务器将更改推送到所有客户端。服务器必须直接或通过让客户端自行注册来了解所有客户端。
  • 让客户端轮询服务器。

There exist alot of techniques, corba, rmi etc etc. However if you want a fully distributed system with no central server, I would personally recommend JGroups.

If you have a central server you can either

  • Let the server push the changes to all clients. The server must be aware of all clients, either directly or by having the clients register themselves.
  • Let clients poll the server.
半透明的墙 2024-10-26 03:08:58

其他简单的解决方案可能包括轮询中央数据库或中央文件。

快速 Google 搜索就会出现:http://www.hazelcast.com/product.jsp。这看起来很有希望,但我没有这方面的经验。

Other simple solutions might including, polling a central database or a central file.

A quick Google search turns up: http://www.hazelcast.com/product.jsp. Which looks promising but I have no experience with it.

葬﹪忆之殇 2024-10-26 03:08:58

对于更复杂的场景,我强烈推荐terracotta
本质上,Terracotta 将部分堆分配到网络,这意味着您的应用程序共享部分堆。共享堆中的一个应用程序所做的更改对于共享该堆的其他应用程序是可见的。主要缺点是 terracotta 需要专用服务器,因为它是中心辐射设计。

For the more complex scenarios I can't recommend terracotta enough.
Essentially terracotta distributes parts of your heap to the network, meaning that your applications share parts of the heap. Changes made by one app in the shared heap will be visible to the other applications sharing the heap. The main drawback is that terracotta needs a dedicated server since it's a hub and spoke design.

酒中人 2024-10-26 03:08:58

Hadoop 项目中的 Apache ZooKeeper 也可能很有趣。我没有这方面的经验,但从网页上我得出结论,它提供了一个分层数据模型。每个对变化感兴趣的应用程序都可以监视特定节点中的变化并根据变化采取行动。

http://zookeeper.apache.org/doc/trunk/index.html

Apache ZooKeeper from the Hadoop project may also be interesting. I have no experience with it, but from the webpage I conlude it offers a hierarchical datamodel. Each application interested in changes can watch for changes in a specific node and act upon the changes.

http://zookeeper.apache.org/doc/trunk/index.html

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