Skip to Content
avatar image
Former Member

Run something once in a cluster environment

I'm looking at using JBoss Cache to cache a large amount of data. If you're unfamiliar with JC, it's a cachine system that will synchronize multiple remote caches in a clustered environment. However, I don't want each cache to load itself at cluster startup, and then sync with all the other caches - there's a lot of data, and I don't want all the caches to become really chatty during startup for performance reasons. I would rather have one server instance act as the master cache, and then have it sync all the other empty caches...

I therefore need a way to determine what node in the cluster I'm running on. How can I programatically do this? I've looked through the API's, but it's like trying to find a needle in a haystack...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 10, 2006 at 07:59 PM

    Does nobody have this requirement to run a task once in a cluster?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2006 at 02:31 PM

    Hi,

    not sure if this helps you - I'm starting a service on the portal on a specified node by using ClusterInformation Service:

    IClusterInformation clusterInformation = (IClusterInformation) PortalRuntime.getRuntimeResources().getService("com.sap.portal.runtime.system.clusterinformation.clusterinformation");
    int curr_server_id = clusterInformation.getNodeId();

    Romano

    Add comment
    10|10000 characters needed characters exceeded