Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Cluster wide singleton?

  1. #1

    Default 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

  2. #2

    Default 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?

  3. #3

    Default

    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

  4. #4
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    Sounds more like a message based system or even P2P.

  5. #5

    Default

    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

  6. #6
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    Yup, just what I thought a message based system could do this. The ESB type of system may have a "pattern" for that.

  7. #7
    Join Date
    Sep 2004
    Posts
    1,086

    Default

    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.

  8. #8
    Join Date
    Mar 2005
    Posts
    10

    Default 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

  9. #9
    Join Date
    Aug 2004
    Location
    Montreal, Canada
    Posts
    35

    Default

    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

  10. #10
    Join Date
    Dec 2005
    Posts
    8

    Lightbulb 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
  •