-
Nov 6th, 2005, 02:40 AM
#1
Cluster wide singleton?
I'm looking for suggestions how to approach to cluster wide singleton implementation. Feature that I'm most urgently need is "hot swappable stand by" mode of operation. Are there any plans to implement cluster wide singletons in Spring?
Damir
-
Nov 8th, 2005, 03:29 PM
#2
more info
We need more information about your architecture to answer the question. Do you have, for example, serveral bean factories on different nodes that need to be able talk to a single bean at a time, or do you have serveral clients that make requests to the cluster and get a single response?
Are you trying to create the same distributed nature of EJB without actually using a complete EJB container or are you trying to share an expensive resource amongst a few JVMs?
-
Nov 9th, 2005, 05:00 AM
#3
Thanks for your interest analogueboy.
I have a need for cluster aware service which provides access to single resource which doesn’t have support for concurrent access (i.e. let's say this is a single file). In same time, invocation of this service should be the same for every client on every node in cluster (also configuration of each service should be same). So, services should elect between them self one master node and a number of slaves for failover. All slave services should proxy their request to master which really executes it. For failover support, if original master fails, between remaining nodes new master should be elected.
AFAIK, there are some open source projects which can serve as a basis for implementing that, (cajo framework, ActiveCluster, JGroups) and there is similar implementation in JBoss (HASingletonController I think), but unfortunately I don't use JBoss and its implementation looks very much bundled in application server.
I'm looking for recommendation which of above projects to use, and if anyone can share some suggestions or, even better, code
about course of implementation.
Damir
-
Nov 9th, 2005, 04:19 PM
#4
Sounds more like a message based system or even P2P.
-
Nov 10th, 2005, 04:57 AM
#5
It seams that ActiveMQ team have a solution in forthcoming 4.x version. Basically, what they implementing under Exclusive Consumer and Message Groups features is what I thought under "Cluster wide singleton" term.
One another open source project catches my eye. It seams that Hedera tries to introduce higher level of abstraction on top of lower level communication libraries. This may be another foundation for Cluster wide singleton implementation. Unfortunately, Hedera lacks almost any kind of documentation for now.
Any thoughts?
Damir
-
Nov 10th, 2005, 06:59 AM
#6
Yup, just what I thought a message based system could do this. The ESB type of system may have a "pattern" for that.
-
Nov 10th, 2005, 07:24 AM
#7
You could try using a cluster-aware cache provider. What you need is no cache, but cache entries are singletons and clustering is built in. SwarmCache or JBoss TreeCache should do the trick.
-
Nov 16th, 2005, 09:14 AM
#8
Singletons
If you're using WebSphere XD then you can use the partition facility. The partition facility allows an application to declare a named partition. The application then receives a load and unload callback in the server the WAS HAManager decides to host the partition/singleton in.
The HAManager provides our group services support and also has support for hardware fencing in split brain scenarios etc. It also has a flexible layout manager in terms of managing which partitions run on what servers etc.
The load/unload callbacks can then use a Spring Bean factory to fluff up the singleton POJOs and start em. I've done this myself so it works well.
Billy (IBM)
http://www.billynewport.com
-
Nov 23rd, 2005, 03:17 PM
#9
Hi Billy,
I there a way to do something similar under websphere 5.5.1? In fact i'd like to call all cluster server (initiated by a single server web interface for instance) to tell them to "resynchonize" a cache if a database table changes.
Alec
-
Dec 8th, 2005, 08:09 PM
#10
JBoss HA-Singleton + JMX
On the project I'm currently working on I deploy a JBoss HA-singleton to make it cluster singleton then use spring to register the required beans with the cluster's HA-JMX server. Access to the singleton is then through the HA-JMX server running inside the cluster.
This way any code requiring to connect to the cluster singleton goes through HA-JMX server to invoke methods on the spring beans. You can lookup the the HA-JMX server in jboss using the HA-JNDI. If you need an example drop me an email.
Doing a HA-JNDI lookup is pretty trivial you can discover the UDP address and port, etc without having to hard code anything. At least it is in JBoss 4.0.2.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules