Java 应用程序复制状态
我在多台计算机上运行相同的服务器端应用程序。
我想提供一种将更改推送到所有应用程序的方法。我对对象本身的状态/属性更改更感兴趣,而不是文件的复制等。
因此,我设想一个管理控制台,我将在其中更改一些属性,并使更改影响每个应用程序状态。
我目前正在研究 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
存在很多技术,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
其他简单的解决方案可能包括轮询中央数据库或中央文件。
快速 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.
对于更复杂的场景,我强烈推荐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.
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