Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 10, 2006 at 07:59 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.